How to migrate a WordPress website without any plugin?

Using Docker environment

Gaurav Neema
2 min readJan 27, 2021
Photo by Jordi Fernandez on Unsplash

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:

Dockerfile-You can change the PHP variables here
docker-compose.yml

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:

Replace the old and the new URL values

3. Replace the wp-content folder
wp-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.

Regenerate files and Sync Library
Replace the URLs

5. Fire Up!
Clear up the browser cache and fire up the website!

That’s all! These are some basic steps that allow you to easily migrate the wordpress website to a new domain. Feel free to connect me on LinkedIn or twitter.

If you ended up liking what I shared and it solved your problem, consider giving some claps 👏.

--

--