Issues restore mysql database

Hi all, I feel like I’m going crazy here. I’m trying to restore my database to a previous version. Here’s the steps I’m doing:

  • stop jetty
  • drop database
  • restore from backup from 1am on the 5th
  • start jetty

When I do that and log back in to xwiki I’m still seeing “recent” activity from users at 3pm on the 5th. It’s as if the restore doesn’t do anything.

I’ve also tried creating a new database with a different name, but get the same results.
One thing that I’m not doing is adding “–add-drop-database” to my backup script.

I know the backups are good and increasing in size:
-rw-r–r--. 1 xwiki xwiki 128M Feb 26 01:05 2019-02-26-01:05:01_xwiki.SQL
-rw-r–r--. 1 xwiki xwiki 128M Feb 27 01:05 2019-02-27-01:05:01_xwiki.SQL
-rw-r–r--. 1 xwiki xwiki 128M Feb 28 01:05 2019-02-28-01:05:01_xwiki.SQL
-rw-r–r--. 1 xwiki xwiki 128M Mar 1 01:05 2019-03-01-01:05:01_xwiki.SQL
-rw-r–r--. 1 xwiki xwiki 129M Mar 2 01:05 2019-03-02-01:05:01_xwiki.SQL
-rw-r–r--. 1 xwiki xwiki 129M Mar 3 01:05 2019-03-03-01:05:01_xwiki.SQL
-rw-r–r--. 1 xwiki xwiki 129M Mar 4 01:05 2019-03-04-01:05:01_xwiki.SQL
-rw-r–r--. 1 xwiki xwiki 131M Mar 5 01:05 2019-03-05-01:05:01_xwiki.SQL
-rw-r–r--. 1 xwiki xwiki 140M Mar 6 01:05 2019-03-06-01:05:01_xwiki.SQL
-rw-r–r--. 1 xwiki xwiki 140M Mar 7 01:05 2019-03-07-01:05:01_xwiki.SQL

Any help would be appreciated. Thanks it advance!

Don’t know what’s your problem and I guess you’ve checked:

Hi vmassol, yes, that’s what I’ve been following, unfortunately with no luck.

Maybe you can help me with the reason I’m trying to restore from backup. A user renamed a bunch of pages, which created a bunch of redirects. Somehow, he went back and re-created the pages with the same name. Those pages are now “redirecting too many times” and are not accessible.

thanks again.

You want to know how to remove a page having a redirect?

Maybe https://www.xwiki.org/xwiki/bin/view/FAQ/How%20do%20I%20remove%20a%20redirect can help?

To remove a direct, edit the page in object mode and remove the redirect xobject.

Thanks vmassol - is there something else I need to do to “flush” the cache or something in xwiki (or maybe jetty?) that is keeping the new changes around, even after the database has been refreshed?

Thanks

If anyone else is having this problem - it turns out that my backups were running, but they weren’t complete. mysqldump was quitting with:
mysqldump: Error 2020: Got packet bigger than 'max_allowed_packet' bytes when dumping table xwikiattachment_content at row: 82
I’ll have to work with what I have.

For working backups you likely want a a larger package size in mysql, like:

 [mysqld]
 max_allowed_packet = 256M

and

 [mysqldump]
 max_allowed_packet = 256M

somewhere in your my.cnf for the backup to work.

Storing attachments on the file system helps to keep the DB small btw:

However you need to backup the data directory where the attachments are stored, too, or the backups will be incomplete.