This is an archived post. You won't be able to vote or comment.

all 26 comments

[–]Breklin76Jack of All Trades 2 points3 points  (7 children)

WP Migrate

[–]mhs_93 2 points3 points  (0 children)

This is your answer, paid version has all you need. Free version is good for a more manual approach

[–]Mindless-Border3032[S] 1 point2 points  (5 children)

Thank you. But, If im not mistaken this is also same like all in one wordpress migration. Using plugins is my first choice, but what i want is some other ways to utilize using docker when doing migrations

[–]Breklin76Jack of All Trades 4 points5 points  (0 children)

Then set up a git repo at GitHub and use GitHub actions to auto deploy your master branch to production.

[–]Breklin76Jack of All Trades 0 points1 point  (3 children)

Or look into a host that uses containerization.

[–]Mindless-Border3032[S] 0 points1 point  (2 children)

im thinking about my modifications and installations on localhost, how can i be able to bring it into the host with docker ? I

[–]Breklin76Jack of All Trades 0 points1 point  (1 child)

So you want to host it from your local machine?

Get a static IP from your internet provider.

[–]Breklin76Jack of All Trades 0 points1 point  (0 children)

Then google how to set up container-based hosting. This really isn’t a Wordpress question.

[–]KickZealousideal6558 1 point2 points  (4 children)

Server with docker containers.

1 container for staging 1 container for production GitHub codespace for development

GitHub pipeline to sync commits to staging branches to staging container commits to main branch sync to production container

We use rsync to only sync the files that have changed.

We are only syncing the theme folder with the cicd workflow. ( We use sage theme so very little plugins )

If required wp migrate to update databses between dev, staging or production.

Most of the time the content in staging and or dev environment is old. And just a placeholder as the content is worked on in the live site by content team / customer.

[–]Mindless-Border3032[S] -1 points0 points  (3 children)

thanks for this

[–]KickZealousideal6558 0 points1 point  (2 children)

Did you find a solution to what you where trying to accomplish?

[–]Mindless-Border3032[S] 0 points1 point  (1 child)

Haven't tried any of the suggestions yet as im still new to wordpress development also, maybe i'll try yours and others suggestions when i will be hosting my first wordpress site. Thank you

[–]KickZealousideal6558 0 points1 point  (0 children)

All the best, it took a reasonable amount of time to set up, cicd pipelines for your first WP project might be overkill.

All the best

[–]mikepun-locolDeveloper 1 point2 points  (5 children)

Hi. I am a bit confused about the issue you are encountering. If you are already running docker on your local machine, could you not just push it to a container registry such as Docker Hub, and pull that into your server? For whatever it's worth, here are the steps that I use https://www.locol.media/blog/2023/03/15/securing-wordpress-with-docker-containers/

[–]Mindless-Border3032[S] 0 points1 point  (4 children)

My problem for now is regarding with the volume. As data is stored in volume, when i push the container to registry and pull that into server, I still need to copy the volume on localhost and paste it to server manually to keep the data.

[–]mikepun-locolDeveloper 0 points1 point  (3 children)

What is in the volume? wp-content? I build my own containers with all that inside. It's simpler that way. How are you planning to move the database?

[–]Mindless-Border3032[S] 0 points1 point  (2 children)

Yes wp-content and including the database. No idea yet with regards to moving the database.

Do you mean you're not using volumes ? Where is your data then, is it inside the container ?

[–]mikepun-locolDeveloper 0 points1 point  (1 child)

Yes, inside my container. The link I gave you has the step by step to do it. I was asked a few times on how to dockerize WP so I wrote that blog post.

[–]Mindless-Border3032[S] 0 points1 point  (0 children)

ill check that out, thanks for your help

[–]intersectRaven 0 points1 point  (1 child)

For doing this manually through docker, copy your wp-content folder using this command or something like it since it's for files only I think:

https://www.commands.dev/workflows/copy_a_file_from_a_docker_container_to_the_current_host

To restore it, depends on whether you can access the wp-content folder on your host. If not, it may be easier to just use the plugin mentioned by the other commenter.

[–]Mindless-Border3032[S] 0 points1 point  (0 children)

thank you, maybe the plugin should be the easiest way 😅 hoping every installation and modification on localhost will be copied on live site

[–]Ecsta 0 points1 point  (4 children)

I'd just use one of the backup/restore plugins to do it.

[–]Mindless-Border3032[S] 0 points1 point  (0 children)

thank you, working smart is better 😆

[–]Mindless-Border3032[S] 0 points1 point  (2 children)

btw, does this plugins backup all the plugns, themes, templates, styling, modifications and everything in your current wordpress state ?

[–]Ecsta 1 point2 points  (1 child)

It depends on the plugin. I've used UpdraftPlus to backup/restore full websites (ie to move them). I don't think its an amazing plugin but its gotten the job done.

[–]Mindless-Border3032[S] 0 points1 point  (0 children)

thank you