Hello @sakowporg,
Thank you so much for getting in touch.
Allow us to break down how we store data on your site database to give you further understanding:
- Global Rank Math settings and connectivity of the plugin to your RankMath.com and Google service: wp_options table
- Individual post/page data: wp_postmeta table
- Analytics, Keyword Manager, Redirections, 404 and caches: wp_rank_math_* tables
And to answer your questions:
- Is there any kind of SEO relevant data on production site that gathered through user traffic while I was doing my updates on staging, which I lose when overwriting the options table and all datatables that contain “_rankmath”?
Yes, which is only the Analytics data and it is perfectly fine for you to overwrite the data after your work with the staging since you can simply just delete the data and fetch a much more updated data from Google.
- Is the best practice here (just in terms of rankmath and the SEO of the production site) to overwrite the options table and all datatables that contain “_rankmath” from staging to production? Or will I lose important SEO data because old settings are overwritten that will decrease my SEO ranking because old pages, posts, products and terms are “SEO wise interpreted as new pages, posts, products and terms and not as optmized old ones”?
It’s fine to override the tables of Rank Math from the changes you made in your staging site. Just make sure that these data aligns with the current posts (example: IDs and slug of posts relative to the data of the Analytics table). If you are not certain, we recommend the settings import instead: https://rankmath.com/kb/import-export-settings/
- If I lose important SEO ranking data on old pages, posts, products or terms when just overwriting the optionstable and all datatables that contain “_rankmath”, which tables should I exclude, when I also do transfer completel new pages, posts or terms? Or does it makes sense in that context that I use the rank math settings import export instead of trying to exclude datatables? If yes, which are there any settings to exlude to not overwrite impotant data on production and why does it make more sense to use that way?
As mentioned on #1, ranking data can be deleted and replaced with latest data from Google by fetching them.
- And with all that in mind, are there any Files or Folders that I should exclude when doing the transfer back from staging to production?
All settings and post/page data you change in Rank Math are all saved in database so there’s nothing to worry about locating files and folders.
- And last but not least, are there any other Rank Math settings besides pages, posts, products and term Rank Math settings that I can optimize in staging and then transfer to production which will overwrite data that should not be overwritten on staging in terms of: “Will be registered as new, which will reduce my ranking” or something similar?
Apart from the posts, terms, and global settings, there’s nothing else to optimize that will affect the migration of data.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Truely excellent response! Thanks a lot!
Just one followup question after reading the import export link:
As you suggested to use “the settings import instead”. Can you describe:
- Which of the many export settings should I use on staging after finishing changes and how should I import them on the production site?
- What should I exclude in the database transfer from staging to production that will better be covered by the export and then import settings process?
Thanks!
Hello @haywoodtools,
At the moment, the exportation of the settings data cannot be done selectively. All settings will be exported and imported to the target site. To import the settings, you’ll just have to navigate to Rank Math > Status & Tools > import & Export and find the Plugin Settings section.
Don’t hesitate to get in touch with us if you have any other questions.
Thanks for your reply. But I am confused now. Let´s Look into my questions and your answers:
- As you can see here https://prnt.sc/8pjRZ9NfT-2F you DO have selective options on export of your settings. So which export settings are you refering to when you say you do not have selective options?
- You did not really answer this question. So let me state it again: What should I exclude in the database transfer from staging to production that will better be covered by the export and then import settings process?
Hello @haywoodtools,
- You should export all the settings from your staging site and import them on your live site.
- You can exclude all Rank Math options in wp_options table if you choose to import the settings manually.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Thanks! How can I identify Rank Math options witin the wp_options table? Do they all have a prefix? Or can you name them if there aren´t too many?
Hello @haywoodtools,
Yes, all Rank Math options start with this prefix: rank_math_ or rank-math-
Here are some values you may check as well in your wp_options table:
rank-math-options-titles
rank-math-options-sitemap
rank_math_version
rank_math_modules
Hope that helps.
ok. let´s summerize:
To push staging from live I can push all files and all tables except of the rows (columns?) in the wp_options table that start with either rank_math_ or rank-math-. Because those settings will only be rewritten to the options-table correctly if I re-import them as settings exported from staging.
Right?
But when I generally need my wp_options table to be transfered from staging to production, as many plugins save their settings into the wp_options table, how or with which tool/plugin should I exclude certain rows(columns) from a single table? The only tools I know for database migration can only exclude files, folders or certain tables, but not certain rows(columns) from within a certain table.
Would this be a possible solution:
First I export the setting from staging. Then I do transfer the complete options table from staging to production and then I import the settings from staging. That way my “not-so-propperly” transfered option table entries will be correctly overwritten by the imported settings.
Right?
Or should I better:
Export the settings from staging. Then delete the option table rows that include rank_math_ or rank-math- (I know tools that can do that). Then I tansfer the options table. And then I import the settings from staging. That way the non existing option table entries will be correctly written into the option table by the imported settings.
Would any of those 2 solutions work? Which one would be better?
Hello @haywoodtools,
The first solution should work. After pushing the staging to live, you can import the settings on your site, and it will overwrite the settings in the options table.
Please do not hesitate to let us know if you need our assistance with anything else.
Thanks so much! That makes it a full circle. Will test it!
Hello @haywoodtools,
Glad that helped.
Please do not hesitate to let us know if you need our assistance with anything else.