The day will come when you will need to move your WordPress website to the new domain. For sure, because it includes situations when you need to publish a site developed on the local environment, to the live hosting infrastructure. Moving a simple WordPress website to another domain or hosting is not a very complicated process. However, it must be done in the right way, to ensure all the changes are correctly migrated and no issues arise on the production version.
So how to properly move WordPress website to a new domain or hosting?
The most important thing: Backup
When moving WordPress site to a new domain start with the backup copy of your website. You can do it manually by exporting the database and downloading files, plug-ins and website theme to your computer and saving them in a separate folder. You can also use WordPress plug-ins (such as Duplicator).
But, regardless of the method you choose, you will need this backup copy to restore your website to the new domain. In addition, the backup can save many hours of work if something goes wrong during the migration process.
Migrating the WordPress website manually
Moving the website manually from one domain to another is a simple and reasonable process. You will have to:
- log to the hosting (having SSH access simplifies things a lot, but an FTP is sufficient),
- compress the website files into a .zip, .tar, or .gz file,
- download a copy of the database,
- replace old URLs in the database with URLs of the new domain using the “Search and Replace” function on the database dump file,
- transfer and extract files to the target server,
- upload the database (usually via Workbench or phpMyAdmin).
Migrating the WordPress website with plug-ins
If you want to reduce your website downtime, and be sure that everything runs smoothly, choose a WordPress migration plug-in. This will easily manage the transfer process.
There are several migration plug-ins available to help you move WordPress site to a new domain. Let’s talk a little about them:
Duplicator is the best WordPress migration plug-in available on the market. It works for many different types of migration scenarios. What’s more important, you do not need advanced technical knowledge to use it.
Duplicator has a simple step-by-step Wizard to guide you through the migration process. It starts with creating a backup copy and downloading it to your computer along with an installer script. Then you upload the script with the backup copy files to the new server or domain. Next run the Migration Wizard, which extracts files and installs the website.
All you have to do is updating the URLs stored in the database.
UpdraftPlus is one of the best WordPress migration plug-ins with way over 3 million active installation. It allows you to seamlessly create scheduled backups to almost any target service or device, be it Amazon S3, FTP Server or a simple e-mail message.
The premium version of Updraft includes a lot of additional automation tools, including a migration service that allows you to create complete backup copy of your WordPress. Import it to any hosting or domain of your choosing, and migrate the website without a hiccup.
Jetpack is an advanced WordPress plug-in that focuses on improving website’s security with powerful backup functionalities. Jetpack’s Backup module allows you to schedule creation of daily snapshots of your WordPress based website. At any time, you can easily use them to restore your website and to migrate it to a new hosting or domain. User friendly backup, restore and migration wizards makes the process really easy and smooth. Combine that with detailed, step by step documentation and you are home.
All-in-one WP Migration
It is a popular migration plug-in with powerful features that support many operating systems and PHP versions. What makes this one stand out is that it’s completely free and yet it offers most of the features needed for smooth and seamless execution of WordPress website migration process. The plugin has been tested at all major Linux distributions and both Windows and MacOS ecosystems. Current version of this plugin has over 3 million active users.
Migrate Guru is a relatively new plugin that advertises itself as the fastest way to migrate any WordPress based website. Developed by BlogVault, it offers full packet of features that allow you to transfer your webpage to new domain or hosting server. Migrate Guru automatically changes URLs, bypasses all of the import and export scripts. It takes care of serialised data of your WordPress. Everything runs automatically with no need of other third-party tools.
However, regardless of the plug-in you choose, you should remember to remove it after the migration process finishes. The unused but active plug-ins can spring a surprise. The unwanted one. Especially if the site is not updated on a regular basis, and a migration plugin leaves open doors to hackers, like it recently happened with Duplicator.
To read more about other WordPress plugins click here.
CI/CD (Continuous Integration /Continuous Delivery)
CI/CD, together with the version control system is mainly used when several people work on the project at the same time. When changes to the website are required frequently. It uses a code repository that allows to upload selected version of the website to the target server, often including automated execution of various tests, to limit the chances any serious bugs will slip into the production version. Therefore, it is typically used to migrate a website from the development environment, through staging up to the live version from one domain/hosting to another.
CI/CD is useful for really large and complicated websites that require constant changes and maintenance. The good coding practice in the case of CI/CD is to use staging server to test development versions of the website before migrating them to the production version. Development versions are updated from GIT repository with use of Jenkins or similar automation tool.
To sum up:
- In case of a new website, the safest and really fast way to migrate it to hosting is the manual one.
- If you are using plug-in to migrate the website, do not forget to uninstall it after the migration process finishes.
- CI/CD is a great solution for large projects under development, but is also the most complex one and requires significant effort to initially set it up.