Yesterday I could not stand the old server’s turtle speed and decide to migrate my WordPress to a new host. My scenario is keeping the Domain name, just change the hosting provider. After I tried the method from website like this one, the pages work fine, but when I tried to access the dashboard, I continuously experienced the error 404. Then I tried another way and it works.
Step1, remove some plugins that contains redirection function, this may cause error 404 after the migration. Such as Cache plugins, Theme my login, register related plugins etc. Because these plugins may change the setting in .Htaccess file, therefore cause the error.
Step2, follow the instruction in the link which including backup database, backup site files, restore database, restore files, use Search Replace DB to edit database. The last step is crucial, In order for images and posts linking to other parts of your site to work, you’ll need to update your domain name in your database.
if you have trouble with import database from phpMyAdmin, then think about ftp the database file to the server, import from mysql command:
mysql -u username -p database_name < file.sql
Can not update WordPress
If you are self hosting wordpress on a linux machine, you may encounter below issue when you upgrade/migrate WordPress:
The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php Installation Failed
This may due to two reasons, SELinux or file permission, issue below commands to fix it.
sudo chcon --type httpd_sys_rw_content_t /var/www/html/frankfuclick/ -R sudo chown -R apache:apache /var/www/html/your_web
Or you can change selinux to permissive for a while during the upgrade, and change back to enforcing afterwards:
First check the current status:
Change to permissive during upgrade:
Change back to enforcing afterwards:
Collation Charset issue
#1273 – Unknown collation: ‘utf8mb4_unicode_ci’
- Open database file with text editor, replace utf8mb4_unicode_ci with utf8_unicode_ci for collation.
2. remove previous Database, create an empty database with utf8_unicode_ci, then try to import the database file.
3, test the page, wp-admin, plugins, media. If any plugin encounters error, better to remove it and reinstall, because the database and plugin may not coordinate with each other after the migration.
Can not change or create new page/post
Possible issue: php version too old, upgrade to 7.2/ 7.3 will fix this issue.
Limit on the upload file size
Find which part is affecting the size limit, create a phpinfo.php file under website folder:
<?php // Show all information, defaults to INFO_ALL phpinfo(); ?>
If the value between local value and master value are different, there are multiple file may be affecting this.
First check Loaded Configuration File part, edit that file usually under /etc folder, ( /etc/php/7.2/apache2/php.ini) , which affect the master value. Open that file, find below fields:
change both of them into your desired limit.
Secondly if your local value is different from the master value. There are may be other files, such as the user.ini, php.ini in the www folder, or your website subfolder, chech them all and fix the two fields above.