How to migrate a WordPress website without any plugin?

Using Docker environment

migrate-wordress-website-without-plugin
Photo by Jordi Fernandez on Unsplash

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 Images
Replace 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.

  • wordress
  • migration
  • docker
  • linux
  • website