We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Update EE database on a different environment after updating code

How Do I?

sceancc's avatar
sceancc
1 posts
one month ago
sceancc's avatar sceancc

Hi, I’ve updated Expression engine locally to version 6.4.2 (starting at 5.4.2) and want to do the same on the production environment. Ideally I want to push the code to production and then update the database to match the version of EE in the code. Is there a cli command that will update the database to match the version of EE in the code or any other way to update just the database? Obviously neither the front end or the admin area will load until the db is updated.

       
JCOGS Design's avatar
JCOGS Design
131 posts
one month ago
JCOGS Design's avatar JCOGS Design

It really depends on whether your local db and production db were in sync before / since you did the local update. If they are then here’s what you could do:

  • take a backup copy of all the files in the production server EE install: to be safe, all of public_html (or equivalent) and system if that folder is not within public_html
  • use your favourite MySQL utility to take a backup copy of the EE db on production server
  • you want these backups in case anything bad happens!
  • use your favourite MySQL utility to take a backup copy of the EE db on your local server
  • put an of index.html file onto your production server saying “back in a few minutes”
  • open copies of your local and production “config.php” files in your favourite code editor
  • copy over the database connection info from production config file to the local one, and then save that as a new file
  • if you have base_url / base_path set in your config.php file, update those too to match the values for your production server
  • copy over all of the files associated with your local EE install to the production server (public_html plus system if not in web root) - take care not to change the folder permissions on public_html on the remote server in case that screws up your server’s access to the files…
  • use your favourite MySQL utility to copy over the backup copy of your local db to the production server
  • copy over your updated config.php file to system/user/config/config.php on the production server
  • see if you can open CP on the production server - if you can huzzah! - if not, go back and repeat the steps …
  • go into CP and check that URL and Path Settings is configured correctly to point to the paths / url for your production server
  • remove your index.html file
  • you should be good to go with updated EE on your production server…

If your production and local dbs are not in sync, then unforunately the only option is to download the entire production server to your local system again, update the newly downloaded version, and then follow the steps above to put it back onto production…

HTH

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.