so i have a website with staging.yml
as
wordpress_sites:
wp.example.com:
site_hosts:
- wp.example.com
local_path: ../release # path targeting local Bedrock site directory (relative to Ansible root)
repo: <repo>
branch: <branch name>
# subtree_path: site # relative path to your Bedrock/WP directory in your repo (above) if it is not the root (like the roots-example-project structure)
multisite:
enabled: false
subdomains: false
ssl:
enabled: false
cache:
enabled: false
duration: 30s
env:
disable_wp_cron: true
wp_home: http://wp.example.com
wp_siteurl: http://wp.example.com/wp
i want to change the host to, lets say example.com
if i rename it here, will my website work?
//ysf
1 Like
I’m not certain whether it would work, but it’s worth a shot. Here’s what I would try:
- backup DB
- backup files
- change stuff to new
example.com
name in wordpress_sites
list
- export a copy of your DB with the URLs/GUIDs etc. find/replace changed to new
example.com
name
- rerun
server.yml
- rerun
deploy.yml
- import DB with new
example.com
name
If somehow it blows up, I’d destroy/rebuild the server and run server.yml
and deploy.yml
, run the wp install screen, then import the DB with the new example.com
name.
TLDR; Backup your stuff and experiment. Staging env’s love that kind of thing.
1 Like
Sorry, for the find/replace in the DB:
-
olddomain.com
becomes newdomain.com
-
srv/www/oldsitename
becomes /srv/www/newsitename
if you are changing site name header
what do you mean by wp install screen?
The first time you deploy using Trellis for a given site, if you navigate to your site’s domain, you’ll see the wp-admin/install.php
screen (if you haven’t already imported a DB or installed WP using wp-cli etc):
I just mean that if you have to rebuild the staging server, you’ll probably run into this screen on the next deploy. You could go ahead with the steps on the install screen, then replace the DB by importing your existing DB, if you have one. That’s just one approach.
oh okay … btw i have updated the server.yml to include this line
- { role: wordpress-install, tags: [wordpress, wordpress-install] }
that way, i wouldn’t have to run the wp command line 
Take a look at @swalkinshaw’s post about Deploying Bedrock Sites and the advantages of following the Capistrano deployment process. The server.yml
playbook deliberately omits the wordpress-install
role so that the deploy.yml
playbook can do its magic. Yes, you need to install Wordpress once after the first deploy, but that’s it. Subsequent deploys are super easy.
okay … can we do an if/else
deploy.yml to to the wordpress-install role?
just a suggestion, i will look into it.
Hi,
I changed from the IP address to the domain name (in sites and hosts) and now have a SSH error when provisioning or deploying:
Failed to connect to the host via ssh. fatal: [example.com]: UNREACHABLE! => {"changed": false, "unreachable": true} to retry, use: --limit @server.retry
EDIT
So, the culprit is Cloudflare : https://support.cloudflare.com/hc/en-us/articles/200169406-How-do-I-SSH-
I leaved the IP address on hosts/production. Not sure if it could create troubles ?
1 Like