So you want to change the hosting and start to have migraine already because the WordPress system seems to be bulky. In this post, I would like to share some methods to survive the challenge.
Before migrating
- Backup all your files. Download and save it somewhere safe. If you have UpdraftPlus or some backup plugins, it may have a lot of versions saved in your WP project folder. You can delete some old backups to free up the space.
- Backup your database. Most important. Download and save it somewhere safe.
- Check if your new hosting provide auto migration. If yes, try method #3 first.
WordPress migrating methods
#1. Stone-age method: Using FTP or File Manager
Even though it takes a lot of time and coffee to follow this, but many times this saved me after trying many methods unsuccessfully.
What to bring to new server?
If your new server has already an existing fresh copy of WordPress installed (nowadays many hosts do), you will just need to upload theses following things:
- /wp-content/ folder,
- wp-config.php,
- and your old database.
Some plugins may not be compatible with the latest version of WP, while the WP on new hosting is always the latest one. In the case that the site breaks and you want to use the plugins, you can delete WP folder and upload your old WP version. (Although I don’t suggest this because latest version means better security).
How to migrate with FTP/ File Manager?
First, from old hosting, go to cPanel > PHPMyAdmin and export your database as .sql
Then, open your .sql file in a text editor (Notepad is good enough). Find and replace all old domain name in the file with new domain name (if there is a new domain name).
You will need a FTP software like FileZilla or WinSCP. Login to your account using the FTP credentials that your host provides and go to public_html folder.
Then replace the /wp-content/ folder and wp-config.php in the new host with your own (remember to save the wp-config.php and .htaccess from new hosting somewhere). This may take a lot of time.
Go to the website and if it has “Error establishing database connection“, you need to refer to the wp-config.php of the new hosting to align its database config with yours.
If the error still exists, you may have an issue with DNS record not yet updated. If flushing DNS cache from your computer does not work, try to access the web page with another wifi or 4G on your phone.
#2. Plugin-lover method: Using WordPress plugins
Many plugins are even free like MigrateGuru or All-in-one WP Migration. In case you want to use plugins, just follow the instructions from the plugin description.
Some notes:
- MigrateGuru is fast and quite reliable but they don’t work on localhost to live site mission or multisite.
- All-in-one WP Migration sounds good on small sites. With big site, be aware that it may output a file of ~1GB and you may not be able to upload to your new WordPress (if your max upload size is only something 125MB).
- UpdraftPlus is just a backup tool, not a migration tool. It may work in some cases, but will easily break the new site also.
Based on your use case, you may only want to:
Migrate only database
Really, in some cases you only need to migrate only database. For example if you store your /uploads/ somewhere on the Cloud (e.g with Google Clouds or AWS S3) and only need the link.
Then on your new site, you only need to install the latest WordPress version and install themes and plugins. Then, migrate database.
In this case, you may want to see MigrateDB Pro (paid) or WP Synchro (free if only migrate DB). Both of these plugins make use of pull/push process to migrate your DB very fast!
#3. Hosting-grandpa method: Use auto migration service that your new host provides
This process is like a breeze. Your new hosting provides auto migration and with a click, your website will be migrated!
At least I know that SiteGround provide this. They will ask you to download their migration tool with a migration key. The process after that is quite simple and straightforward.
For me, the migration tool of SiteGround worked on 9/11 times. 2 times it did not work:
- Trying to migrate a Woocommerce website from Bluehost to SiteGround. Design of the theme broke.
- Trying to migrate from the Siteground temporary domain to another domain hosted also here. Never processed, informed error reading resources or so.
#4. Catastrophe method: Only have access to old and new WP Dashboard
In this case you don’t have access to FTP, cPanel, SSH or whatever back-end stuff. That’s why it is called Catastrophe method, or more politely, Blogger method. Basically you will need to do all the labor job of creating a total new WP site.
If you can install plugins, try method #2. If none works, then try the below.
You can export files using WordPress Importer tool (free). Unluckily this plugin only allows to export content, not /uploads/ folder, not even plugin settings. So you may want to use also WP Export Media Library to download your images.
Then, go to your new website, install all themes and plugins necessary. You need to magically memorize all the plugins settings and duplicate it to the new site.
Again, use WP importer to import all content. You also can upload the images from the zip file downloaded by WP Export Media Library.
#5. GitHub method: For command lines fans
As mentioned before in WordPress workflow, GitHub can be used to host your code which can be quickly pulled into a new server.
The prerequisite: you need SSH terminal to login to your root folder and perform actions from the command line.
Sometimes you would need to perform extra action e.g secure your .git folder from public access.
I think nowadays some hosts also provide GitHub services so make sure to check their documentation if they have.