• How to overwrite corrupted database with backup database using phpMyAdmin?#

  • Bytesource Reply #1, 2 years, 11 months ago

    Reply
    Hi all,

    I just upgraded to MODx Evolution. Somehow I must have made a mistake because the install overrode my existing database content! I do have a database backup, but I don't now how to import it to override the wrong content. Both databases have of course the same name and prefix.

    I am using phpMyAdmin so I would be very glad if someone could tell my briefly how to accomplish this task. I do not have any clue about MySQL, so an explanation for "dummies" would be fine...

    Right now my three months of work is not usable any more.

    Looking forward to your reply!

    Best regards,

    Stefan




  • BobRay Reply #2, 2 years, 11 months ago

    Reply
    Before doing anything drastic, go into PhpMyAdmin and make sure the site's content is really gone. Select the MODx database, select the modx_site_content table and click on the browse icon. If you can still see your content there and there are a number of records, it's not gone, just not showing for some reason. Stop there and let us know if this is the case.

    Unless you checked "new Install" (and it shouldn't have been checked by default unless you deleted some files before upgrading) MODx shouldn't have trashed your content--and I've never seen it do that.

    If the site's content is really gone, I would first click on Export (still in PhpMyAdmin) and export the whole thing as a SQL file to your local machine (click on save to file), just in case. You can look through that file with a text editor to double check that your site content is gone.

    I'm assuming that your back up is a fie with a .SQL extension. If not, stop here and let us know what it is.

    While still looking at the current DB, you can click on "select all" to put a check mark next to all tables and then use the bottom drop-down "with all" menu to select drop. Confirm and you will have a completely empty MODx database. Now click on import and browse to your backup. Once it's imported, you should be back where you were when you backed up.

    Hope this helps. Ask if you get stuck or confused.


  • BobRay Reply #3, 2 years, 11 months ago

    Reply
    Quote from: BobRay at Jun 14, 2009, 10:10 PM
    First, is it possible that you upgraded to MODx Revolution rather than Evolution?

    Before doing anything drastic, go into PhpMyAdmin and make sure the site's content is really gone. Select the MODx database, select the modx_site_content table and click on the browse icon. If you can still see your content there and there are a number of records, it's not gone, just not showing for some reason. Stop there and let us know if this is the case.

    Unless you checked "new Install" (and it shouldn't have been checked by default unless you deleted some files before upgrading) MODx shouldn't have trashed your content--and I've never seen it do that.

    If the site's content is really gone, I would first click on Export (still in PhpMyAdmin) and export the whole thing as a SQL file to your local machine (click on save to file), just in case. You can look through that file with a text editor to double check that your site content is gone.

    I'm assuming that your back up is a fie with a .SQL extension. If not, stop here and let us know what it is.

    While still looking at the current DB, you can click on "select all" to put a check mark next to all tables and then use the bottom drop-down "with all" menu to select drop. Confirm and you will have a completely empty MODx database. Now click on import and browse to your backup. Once it's imported, you should be back where you were when you backed up.

    Hope this helps. Ask if you get stuck or confused.


  • Bytesource Reply #4, 2 years, 11 months ago

    Reply
    Hi BobRay,

    Thanks for your detailed reply! The database has been indeed overridden. I must have checked this during the upgrade. I do not have another explanation for this.

    I then logged into phpMyAdmin, selected the database and imported my database backup file (with DROP TABLE statements) . Now I have my content back! Thank you so much for your help!

    There is just one tiny little problem left: When trying to edit a document, an error window pops up telling me the following:
    TinyMCE - OnRichTextEditorRegister
    Warning: include_once(/var/www/modx/assets/plugins/tinymce3211/...

    The new install is using TinyMCE 3241, but here MODx is still looking for the old version.

    How does MODx know which version to choose? Is this written in a configuration file? Can I change the name there?

    Best regards,

    Stefan


  • BobRay Reply #5, 2 years, 11 months ago

    Reply
    Glad it worked for you.
    You can't just change that line because you have the wrong TinyMCE plugin code in your database. It probably won't play nice with the included files.

    If you run install again (but be careful to pick "upgrade" ) I think it will update TinyMCE for you.



  • Bytesource Reply #6, 2 years, 11 months ago

    Reply
    I upgraded another install and made sure it really was an upgrade, not a new install. However, MODx complained again about the TinyMCE version. Is there anything else I can do to solve this problem?


  • BobRay Reply #7, 2 years, 11 months ago

    Reply
    Hmmm ... I really thought that would do it.

    First, try clearing the site cache and your browser cache and cookies.

    If that doesn't work, what I would probably do next is to delete the TinyMCE plugin in the Manager, clear the site cache, log off, and run the upgrade install again.

    If that didn't work, I'd download a new copy from the repository:

    http://modxcms.com/extras/package/?package=459
    Then, follow the install instructions there to install it.

    Someone else may have a better suggestion.


  • Bytesource Reply #8, 2 years, 11 months ago

    Reply
    I logged out of the MODx manager, deleted the installed version of TinyMCE, downloaded the latest version of TinyMCE from the Repositories, installed it, and logged into the MODx manager again. Now everything is working as expected!

    Thanks for your great help!

    Stefan


  • BobRay Reply #9, 2 years, 11 months ago

    Reply
    We aim to please.
    Glad it worked out.


  • vietnam idol Reply #10, 1 year, 8 months ago

    Reply
    My friend tell me that he is trying to import a file which he exported from another system... he is moving a database from one machine to another. The new system does not have phpmyadmin installed, so he tried to import a sql file created by myphpadmin export using MySQL Workbench...

    Please help my friend !
    _____________________
    vietnam idol