How to migrate a WordPress website without any plugin?
Using Docker environment
Migrating a WordPress website sounds so easy, and really is. But there are few caveats that you need to keep in mind if you are doing it for the first time. This story will guide you on how to migrate the WordPress Website easily without the use of any plugin.
Requirements
- docker
- docker-compose
Steps
1. Installing WordPress
Setup WordPress using docker. Here is the and Dockerfile
and docker-compose
file for the same. Please change the username, password, database names accordingly:
Build and start up the application using the command:docker-compose up -d
2. Database changes
Backup the database from the old environment and restore it to the new environment inside docker. The links and certain URLs will still point to the old environment in certain tables in the database. Use the following queries to change the URLs:
3. Replace the wp-content folderwp-content
is the directory where all the changes you made to the website goes. This includes imports, pages, PHP code, etc. Copy the folder from the old environment and paste it into the new environment after deleting the existing one.
4. Finalizing stuff
I was using Elementor page builder which provides the option to regenerate CSS, sync files and replace the URLs. If you are not using Elementor, you can skip this step or perform the equivalent step if you are using another page builder.
5. Fire Up!
Clear up the browser cache and fire up the website!