evertramos / docker-wordpress

Wordpress Docker container using SSL Certificates with LetsEncrypt
https://evertramos.github.io/docker-wordpress/
MIT License
484 stars 156 forks source link

How to change the domain of a container? #31

Closed chwzr closed 5 years ago

chwzr commented 5 years ago

I have a wordpress setup which is made with this repo. lets say with domain example.com The client want to switch his domain to notexample.com... I Could not figure out how to switch it without loosing data ? Any steps recommended here?

chwzr commented 5 years ago

figured it out.

Just delete the wordpress container

docker rm -f wordpress

then change the domain in the .env and docker-compose up -d

now the only thing to change is the site-url in the database, or define it in the wp-config.php.

If you do not have a other method which does this automaticly, please close this issue :)

evertramos commented 5 years ago

Hello @chwzr,

In fact you don´t need to delete the container... you could just change the url in the .env file and restart the container... that should do it.

Glad you manage to fix it.