Dev environment

  • dev.angama.com has own db and own copy of the uploads folder (to allow write new images during development)

  • code.angama.com has own db and a link to dev’s uploads folder (with write permissions, because code in the dev group on the server)

Updating databases and files

(as a root user)

Update the databases

(for dev & code)

  1. mysqldump -u root -p{x} {originDb} | mysql -u root -p{x} {targetDb}

  2. change site url & home url in the options table

  3. replace the old urls to the new in all tables (e.g. via the Better Search Replace plugin)

Update the uploads folder

(for dev only)

  1. rm /home/dev-angama/www/html/wp-content/uploads/* -rf

  2. cp /home/angama/www/html/wp-content/uploads/* /home/dev-angama/www/html/wp-content/uploads -r (will take some time, maybe 15min)

  3. chown dev-angama:dev-angama /home/dev-angama/www/html/wp-content/uploads -R

  4. sudo find /home/dev-angama/www/html/wp-content/uploads -type d -print0 | xargs -0 sudo chmod g+w (adding a writing capacity to the group, so the code user will be able to write)

Staging settings

In site settings (admin area, for dev & code)

  1. change Google Analytics code to dev (!important)

  2. enable Staging mode with http protecting

  3. in WP General settings change the client email to another to avoid getting them notified about technical issues on Code/Dev

Last updated

Was this helpful?