Child pages
  • [console] Command for fixing urls when DB is moved to production
Skip to end of metadata
Go to start of metadata

The workflow we're using at Intechnic is like this:

  1. we configure staging server, where all latest changes from VCS are deployed
  2. client populates website (while on staging server) with data
  3. we configure production server
  4. we copy all client entered data (db, images, etc) from staging to production server

Tricky part is the database because:

  • urls to images in content blocks contain "/website-name/" in front of them because on staging server all websites are placed in sub-folders and this part needs to be removed
  • some configuration settings of In-Portal contains full path on disk (e.g. backup folder), where again staging server is mentioned
  • having WordPress on website adds more problems during migration:
    • the urls to all images are absolute ones and point to staging server
    • staging server url is used to created GUIDs of posts
    • staging server url can be mentioned in e-mail templates
    • staging server url can be mentioned in configuration

Doing all that manually isn't easy.


Create "db:replace-staging-urls" command, that will:

  • ask for staging url of website
  • ask for production url of website
  • do all the job

Command needs to be executed once on production website only.

Related Tasks