Staging Site transfer to production
-
Hi!
I have a production and a staging site. The staging site is a copy from the production site where i did reset site kit here: Site Kit > Settings > Admin Settings > Reset Site Kit
Then I did some changes on the staging site like adding pages, editing meta titles and descriptions on old and new pages. Used rank math to create new xml sitemaps. I did not change any site kit settings on staging besides resetting it in the beginning.
Now I want to transfer the staging site with all the changes to production site. What is the recommended procedure to avoid overwriting any imortant Site Kit related data on production? Meaning: Can I just copy everything to production or do I need to exclude files or database tables? Or do I need to change settings in Site Kit after the transfer to adapt to the new setting?
-
Thanks for reaching out @sakowporg and great idea to check in with best practices before migrating.
Before you transfer your site to production, ideally you would reset Site Kit first, which you already did. Doing so ensures that the site ID for this site is independent of your site on production, leaving your to set up the site on production without the likelihood of running into any invalid callbacks.
When setting up Site Kit on the production site after transferring, you will need to connect all modules previously connected. Note that as the site URL will be different, the data you see will differ.
What is the recommended procedure to avoid overwriting any imortant Site Kit related data on production? Meaning: Can I just copy everything to production or do I need to exclude files or database tables?
Site Kit pulls it’s information from the respective Google products: Search Console, Analytics, AdSense etc, as opposed to storing this locally in your database. For that reason the data you see within Site Kit will match what you see from search console, analytics.google.com or AdSense. You don’t need to configure anything specific when migrating or moving to production other than resetting the plugin.
Let me know if you have any questions with the above.
Just to see if I understand correctly:
I copy the reseted staging site and overwrite the production site with it. Then I reset the site kit plugin on production. And on a next intervall it will gather all original metrix but also correctly implement the new pages and sitemaps. Everything is as it should, right?
But in that case I do not understand your sentence:
“When setting up Site Kit on the production site after transferring, you will need to connect all modules previously connected. Note that as the site URL will be different, the data you see will differ.”
- What exactly do you mean by “…you will need to connect all modules…” Will I not only have to reset the Site Kit plugin, but then also redo the wizard?
- Why do you say the URL is different? When I copy staging to production my transfer tool will search and replace all staging URLs to become the original production URLs. So when after that I reset the Site Kit plugin the URL of production is the same as it was before the overwriting from staging. It just has some changed pages and sitemaps. So will I lose all recorded visitor data for all pages, or only for those pages that have changed content or another position within the sitemap -> another permalink?
Happy to answer your further queries here @sakowporg, and sorry if there was any confusion.
I copy the reseted staging site and overwrite the production site with it. Then I reset the site kit plugin on production. And on a next intervall it will gather all original metrix but also correctly implement the new pages and sitemaps. Everything is as it should, right?
This is where I may have been confused. Typically, Site Kit should be reset on staging <span style=”text-decoration: underline;”>before</span> migrating to production if the plugin was already setup on staging (using a staging site URL). In your case, if you’re copying files over and you don’t have Site Kit set up already on staging, this may not be a concern assuming the plugin is already working on production. Site Kit stores minimum information in a users WordPress database. As long as your site URL is not changing, and your WordPress constants (ie. Salt Keys) are not changing when migrating from staging to production, the plugin should remain intact if the Site Kit plugin directory remains present.
Note that depending on the migrating tool you’re using to push from staging to production, there may be other concerns. (ie. Does each update replace all your existing plugin directory files, does it use your existing production database or a new one).
With regards your query on sitemaps, Site Kit doesn’t register any sitemap data or display any sitemap information. The plugin therefore doesn’t register any such information in a users database.
What exactly do you mean by “…you will need to connect all modules…” Will I not only have to reset the Site Kit plugin, but then also redo the wizard?
If after migrating from staging to live, depending on what changes are made, the plugin may ask you to complete set up once more (ie. If you WordPress constants change). You may not need to go through the full setup process (ie. with Analytics), as the connected services may remain intact as long as your site isn’t reset. If your site URLs are not changing with your migration plugin, you do not need to reset first. Apologies for any confusion here.
Why do you say the URL is different? When I copy staging to production my transfer tool will search and replace all staging URLs to become the original production URLs. So when after that I reset the Site Kit plugin the URL of production is the same as it was before the overwriting from staging. It just has some changed pages and sitemaps. So will I lose all recorded visitor data for all pages, or only for those pages that have changed content or another position within the sitemap -> another permalink?
Thanks for mentioning how your migration tool operates. You won’t loose any Analytics or other data on your live site after migrating from staging to live in this case. As stated above, if you’re WordPress constants are changed, you may need to set up the plugin once more, but once complete the modules remain intact. Even if you happen to perform a plugin reset, whereby Analytics and other modules become disconnected, you can always go ahead and connect then once more. As Site Kit pulls data from the relevant services (ie. analytics.google.com), your data is not “lost”.
Hopefully the above is a bit clearer. What I would suggest when migrating from staging to live, is to not reset the plugin if your site URLs are not changing. If your WordPress constants are changing, I can provide you with a filter to ensure you are not asked to set up the plugin with each push from staging to production. If you want to share any tool you’re using to perform updates from staging to production, I can also check what configurations are available and assist with this further.
Thanks for the detailed answer.
I am using a mixed setup:
I use Plesk wordpress kit to make a clone from the current produciton site to subdomain including making a clone of the database. This is my staging site where all URLs are changed to the subdomain.
Once changes on staging are done I use the WP Staging PRO to move the staging back to production after changes are done. I am not using Plesk here because it lacks some of the “exclude functionality” that WP Staging PRO offers. But as said, after WP staging moves the staging site to production all URLs and all database tables are back to the original production naming.
And if I need to test changes for the site again on a staging site I redo the production to staging and staging to production loop. To always have the latest settings on staging.
So all this said I do not think Plesk′s wordpress kit or WP Staging PRO does change the Salt Keys. But you say that Site Kit would asks me to connect again if they would and that would mean that I have to then add your your filter script as a snippet to my functins.php to avoid these unneeded procedure, right? Then I guess I make sure that does not happen with you giving me that snippet, ok?
Appreciate the update @sakowporg.
Based on your setup, I would suggest first of all deactivating Site Kit before make a clone from the current production site to subdomain. This is a standard plugin deactivation, not a reset. On staging (with your subdomain), you can then make whatever changes necessary. After using WP Staging PRO to move your staging to production, you can then activate the plugin once more. If your SALT keys are not changed, all should work as normal.
You don’t need to perform a plugin reset if following the above. I mention to deactivate Site Kit before moving to staging because without going so, the plugin will recognize a URL change based on your subdomain, suggesting you set up the plugin once more (on staging, which wouldn’t be ideal).
So all this said I do not think Plesk′s wordpress kit or WP Staging PRO does change the Salt Keys. But you say that Site Kit would asks me to connect again if they would and that would mean that I have to then add your your filter script as a snippet to my functins.php to avoid these unneeded procedure, right? Then I guess I make sure that does not happen with you giving me that snippet, ok?
That is correct regarding adding your Site Kit constant keys, which the plugin can use as opposed to your SALT keys. More details here.
Let me know if you have any questions with the above.
That sounds great! Will try this setup. Thanks!
Not a problem. Be sure to reach out if you have any further queries.
- The topic ‘Staging Site transfer to production’ is closed to new replies.