Mailing List Archive

How to restore database
Hi,

Did I restore my database correctly?

Do I need to delete the database first?

Here's what happened:

I had trouble after upgrade of MW1.31.1 to MW1.35.1. I had had success
with this upgrade on the test version of my wiki, but ran into a
problem with the upgrade of the production version of my wiki. I may
post about that later. Meanwhile, to revert back to the 1.31.1 version
of my production wiki I moved the old files back in place:

-$ mv teflpedia teflpediaNEW; mv teflediaOLD teflpedia

And to revert the database and be rid of whatever changes I had done
when I had run MW1.35.1's maintenance/update.php, I did:

-$ gunzip < ~/bu/bilbo_teflpedia.20210130.MW1.31.1.sql.gz | mysql -p
bilbo_teflpedia

The database for the wiki is named bilbo_teflpedia, and I had created
that .sql.gz just prior to my upgrade attempt, with this:

-$ mysqldump -p --default-character-set=binary bilbo_teflpedia | gzip
> ~/bu/bilbo_teflpedia.20210130.MW1.31.1.sql.gz

Few!

Also, I had set my webhost to PHP 7.3.26 via cPanel, which both
MW1.31.1 and 1.35.1 are compatible with, before the upgade attempt.

Now I'm wondering, did I *combine* the new database with the old one
with that: -$ gunzip < ~/bu/bilbo_teflpedia.20210130.MW1.31.1.sql.gz |
mysql -p bilbo_teflpedia

Did I properly *replace* the bilbo_teflpedia database with the old one?

Do I need to delete the bilbo_teflpedia database first?


Thanks for any advice!

Roger Chrisman, venomous spider at teflpedia.com one bug at a time

For reference, here's my
* production wiki: https://teflpedia.com/Special:Version
* test wiki: https://tp.rogerchrisman.com/Special:Version

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Re: How to restore database [ In reply to ]
Hello,

I have been reading the fine manual at
https://www.mediawiki.org/wiki/Manual:Restoring_a_wiki_from_backup

That ^ page suggests I might delete any dubious database before
restoring into it. My wiki seemed to be working fine. But I didn't
_feel_ fine. My imagination wove lots of imaginary oops into trying to
restore a MW1.31.1 database into itself after having run MW1.35.1
maintenance/update.php on it. So I did the following -- I moved the
old database, created new database, restored database, as follows:


I moved my database bilbo_teflpedia to bilbo_teflpedia_mush in cPanel
>> MySQL Databases. (I could move it back if oops, or delete it later
if all goes well.)

Then I created a new empty bilbo_teflpedia database in cPanel >> MySQL
Databases.

Then I restored my wiki1.31.1 database into that new database from the
command line with:
-$ gunzip < ~/bu/bilbo_teflpedia.20210130.MW1.31.1.sql.gz | mysql -p
bilbo_teflpedia


Wiki seems to be working fine. Have I done that restore correctly?

Roger

For reference
* production wiki v 1.31.1: https://teflpedia.com/Special:Version
* test wiki v 1.35.1: https://tp.rogerchrisman.com/Special:Version

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Re: How to restore database [ In reply to ]
> On 31 Jan 2021, at 00:39, rogerchrisman@gmail.com wrote:
>
> -$ mysqldump -p --default-character-set=binary bilbo_teflpedia | gzip
>> ~/bu/bilbo_teflpedia.20210130.MW1.31.1.sql.gz
>
> Few!
>
> Also, I had set my webhost to PHP 7.3.26 via cPanel, which both
> MW1.31.1 and 1.35.1 are compatible with, before the upgade attempt.
>
> Now I'm wondering, did I *combine* the new database with the old one
> with that: -$ gunzip < ~/bu/bilbo_teflpedia.20210130.MW1.31.1.sql.gz |
> mysql -p bilbo_teflpedia
>
> Did I properly *replace* the bilbo_teflpedia database with the old one?
>
> Do I need to delete the bilbo_teflpedia database first?


I’m not an expert by any means but I think add-drop-table is included by default in the mysqldump command:


--opt

This option, enabled by default, is shorthand for the combination of --add-drop-table --add-locks --create-options --disable-keys --extended-insert --lock-tables --quick --set-charset. It gives a fast dump operation and produces a dump file that can be reloaded into a MySQL server quickly.


--add-drop-table

Write a DROP TABLE statement before each CREATE TABLE statement.


https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#option_mysqldump_add-drop-table

Best wishes

Jonathan
Re: How to restore database [ In reply to ]
Jonathan, thank you for your reply.

I had forgotten to put .htaccess into my root dir for my short URLs.
Got that in now and the upgrade worked!

Best regards,

Roger :)

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l