Best practice for restore MariaDB database / ispCpnfig3

Discussion in 'Installation/Configuration' started by kameleon1er, Jun 28, 2022.

  1. kameleon1er

    kameleon1er Member

    Hi there, sorry I'broke something else today :( my main wordpress MU database. Cause 302 and 301 redirect somewhere, I tried a "search & replace" plugin. It broke everything.

    I have a dump from ex-server.
    DB.sql.tar = 28 Mo > (current server/var/tmp)
    Is there option to restore it with isp ? (phpmyadmin I suppose)
    or mysqldump cmd ?
    I need to replace the corrupt one.
    Code:
    MariaDB [(none)]> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | c0aps1             |
    | c0aps2             |< THIS ONE
    | c0aps3             |
    | c0aps4             |
    | c0aps5             |
    | dbispconfig        |
    | information_schema |
    | mysql              |
    | performance_schema |
    | phpmyadmin         |
    | roundcube          |
    +--------------------+
    Thanks.
     
    Last edited: Jun 28, 2022
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    phpmyadmin or mysql cli are the tools to restore a sql dump. Likely you can't use the .tar file directly with either, assuming it actually is a tar archive; use "tar tf DB.sql.tar" to see what files are contained in the tar archive. If that shows valid file names (or at least one name), you can use "tar xf DB.sql.tar" to extract the file(s), and if they are .sql files you are set to head over to phpmyadmin.
     
  3. kameleon1er

    kameleon1er Member

    Hi Jesse, ok It's a .sql file, but the name is different from the original.
    If I remember correctly, I have to empty the database tables before importing into phpMyadmin?
     
  4. kameleon1er

    kameleon1er Member

    Problem with PhpMyAmdin, when I'm looking the .sql file : 263 Mo…Pretty huge.
     
  5. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    You could use mysql command line if needed, it should handle most any sized input.
     
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Sometimes the sql file will include "drop table blah..." statements, other times you may have to manually drop the tables first.
     
  7. kameleon1er

    kameleon1er Member

    Done, by security, I deleted all tables by PhpMyadmin, and dump < by cmd lines. I think it's ok.
     

Share This Page