Archived topic
Setup GP on Staging without losing new changes on Production
12 replies · Started by Sean on June 23, 2021
Hi. I am going to be changing from another theme to GeneratePress. In order to get GP Premium ready for the live site, I'll be working in a staging environment. I've already copied production to staging. However, since it will take a while to get the theme and new pages ready, changes and additions to custom post types, media (new images uploaded and set as featured images for existing posts), and users will occur on the production environment before I can copy staging to production.
I'm on WP Engine, so I can use their "Copy environment" feature to copy the "Database and file system" or only the file system. However, I wasn't sure if either method will allow me to 1) get GP Premium and GenerateBlocks installed, configured and customized on Staging so that it works as desired with the plugins that are installed, and 2) not lose any of the changes that have happened on production since it was copied to staging.
What do you recommend for cases such as mine? Is there a way keep the changes from both environments? Thank you.
Hi Sean,
I believe WP Engine's copy environment is full clone of the site meaning whatever was on the production site will copy fully copied to the staging site. But I can't be sure about this so it's best to confirm with WP Engine about this.
As for the development, a staging site doesn't automatically apply to the live/production site unless you commit dev/staging to the live/production site. The production site stays unchanged unless instructed otherwise.
That's the basic idea on why we have staging sites, its so the live/production site can still be used by your site's customer/visitor while we do the development changes on the staging.
Normally, the procedure is like this:
1.) Set up the site on the host. (creation of the site)
2.) Setup 2 or 3 environments. (staging and live. Although, some hosts, like Pantheon does 3, dev > test > live)
3.) Leave the live site alone.
4.) Do the changes on the staging/dev site
5.) Test for bugs (this is Quality Assurance)
6.) Once dev/test environment is all good, you can commit the change to the live site.
7.) Repeat steps 3-6 for future development/changes.
That's pretty much a brief summary of the development cycle.
Hi Elvin,
Thank you very much for the reply and information. I've used WP Engine's staging and production environments before, and have a rough idea of the development process. I guess my question is, if I'm setting up GeneratePress Premium on staging, would the theme be entirely within the file system, or does it save anything to the database? I know new pages/posts would be in the database, but wasn't sure if the theme saved anything in the database or if everything would be in files. Thank.
Hi there,
the theme and GPP Premium will save its settings to the database.
Thanks David. So if GP and GP Premium will be saving to the database, how would I be able to work on the theme on staging and copy that to production when finished without overwriting other changes that have occurred on production during development? Does GP and GP Premium save all of its data/settings to certain tables? If so, is there a list available? Just trying to establish where all of the GeneratePress data will be on staging so that I can then copy only those files/database tables to production so I don't lose any other changes that've happened on production while I've been working on the theme on staging. Thank you!
You can export the GP premium setting from the staging and import it on the production so you don't have to copy/merge the staging's database to the production.
The export setting is on Appearance > GeneratePress. You'll see it on the right-hand side.
https://share.getcloudapp.com/jkuPvgxm
Thanks. So just to confirm before I start working on staging...
Everything that can be configured for GeneratePress and GeneratePress Premium will be included in the Import/Export?
And for any posts or pages that are created on Staging with GeneratPress/GenerateBlocks, I'd need to use another plugin (such as WP All Export and WP All Import) to export those from Staging and Import them to Production so that I don't have to merge the databases?
The import/export module will handle all customizer options.
For pages, posts and elements, you should be able to just use the export tool in WordPress.
Or a plugin like Duplicator might make it easier.
Thanks Leo. After researching this further, I consulted WP Engine and they recommend "If you are using a theme that stores settings in the database, it would be best make the changes on Production and leverage the Preview Site theme feature as well as our Backup system." However, given that I need to create a new child theme and make new template override files for customizing how a plugin renders its content on my site, I don't think the Preview Site option will offer enough flexibility for debugging, etc.
If GeneratePress's import/export feature will handle all of the customizer options and I can use my host's copy environment feature to push staging files to production, I think that should just leave the content (pages and elements) that are created or edited on staging.
I'd rather not export/import ALL of the pages and posts, as the database is very large (thousands of pages and posts). Is there another tool or plugin that will allow me to export only specific pages and elements?
In my case, I'll be updating a few existing pages (that were created with another page builder) and converting them to use GP and GenerateBlocks. The slug/URL will be the same, so I'll just need a way to export the "new" version of the page from staging and import it to production (or, if it's possible to "copy" the page content/blocks when editing the page in WP admin on staging and paste that into the page when editing it on production, that would be a feasible workaround). Let me know if either of these is possible or what you recommend given that it's only a handful of pages that need to be updated. Thanks again!
Is there another tool or plugin that will allow me to export only specific pages and elements?
I'm not aware of a plugin that offers this specific option unfortunately. You will need a try a few plugins and see if any of them offers this functionality.
Another method that might be worth considering:
https://youtu.be/CsT1UOzZUgI
Thanks so much Leo! This video is extremely easy to follow and is exactly what I was looking for in my case (for the handful of pages I'll need to move from staging to production).
Glad to hear :)
Marking as resolved