Skip Navigation

[Resolved] export database without corrupting views

This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by Minesh 6 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#513864

I am trying to: I exported a copy of mySQL database in .sql format. I do this for all my websites as a precaution. If corrupted or hacked, I can put back the backup. So something went wrong with Views, and I put the database backup.

Well, it worked, except all my views were corrupted. Took me 3 hours to redo all views by hand.

The views were there, except they were not working. When opening a views, it had NOT any custom post type selected. I couldn't work because it was not assigned to any CPT.
So first I had to reassign.
Then, it also lost ALL filters - and filter output. For example, if "child of" was selected in Filter. Then there just was nothing selected in filters in the imported database. I had to redo all filters.
Surprisingly, the Loop output was still there and OK.

I nedd to know: how to export the database and/or ho to reimport it without loosing all views? Does this mean I can never backup my site ?

#513928

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please check following guide that will help you to migrate your site to one domain to another one without any issue:
=> https://toolset.com/faq/how-do-i-migrate-a-wordpress-site-from-one-domain-to-the-other/

#514027

But that's exactly what I did! I followed that tutorial!
And that didn't solve it!

I still have 255 places in wp_posts and wp_postmeta where my old localhost url still appears, even after I followed the instructions in the URL above.
- If I do a find-replace in SQL like UPDATE wp_posts SET post_content = replace(post_content, 'hidden link';, 'hidden link';);
Then all views are corrupted. They loose the assigned CPT.
- So I tried by hand, changing the URL in SQL guid or post_content: DOES THE SAME THING: CORRUPTS VIEWS
- So I dropped the tables and put back my backup version of the database that I had just done
THE VIEWS WERE CORRUPTED FROM THE IMPORT

I had to redo 65 views by hand.

This is driving me nuts.

- How an I change ALL instances of localwebsite to livewebsite in database ?
in works when using %{%'; at the end of SQL statement,
but does NOT replace all.
They are a lot of /\/\localwebsite/\/\ left. Changing by hand one by one still corrupts views.

#514042

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

So - if you are just moving your site from one domain to another one, what if you try to use Duplicator plugin.
=> https://wordpress.org/plugins/duplicator/

Using this plugin you can transfer your site without any headache. Please check following tutorial;
=> hidden link

#514044

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

So - if you are just moving your site from one domain to another one, what if you try to use Duplicator plugin.
=> https://wordpress.org/plugins/duplicator/

Using this plugin you can transfer your site without any headache. Please check following tutorial;
=> hidden link

#514065

This is bad:
Last night I created 6 views. They worked fine.
This morning I get an email from the client that they are not working.
I got check the website live, and the VIEWS ARE CORRUPTED
And I didn't touch anything!
They lost the associated Custom post Type again!

Now this is beyond moving the database.
I didn't touch anything, and the views get corrupt for no reason, at random times.

Please, how can I fix this ?

#514070
problem4.jpg

Here's what happens to view.
- This happens on every view if I export / import database
- This happens on every view if I go into MySQl and change a character manually in one cell
- Now this happens randomly, for no reasons

#514077

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Did you tried duplicator - as I suggested here?
=> https://toolset.com/forums/topic/export-database-without-corrupting-views/#post-514044

Also,
Could you please send me debug information that will help us to investigate your issue.
=> https://toolset.com/faq/provide-debug-information-faster-support/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.