Menu

#5585 Cannot Restore Virtual Server With External DB

2.000
closed-fixed
nobody
None
5
2022-10-30
2022-10-14
Eric
No

Hi,

When trying to restore a virtual server we are moving from one server to another only the front end server is changing the EXTERNAL DB server is not changing. When we backup the server even if we do NOT backup mysql databases when we goto restore on the new front end server webmin stops and says the DATABASE exists on the remote DB server and will not continue the restore. Even if we DESELECT mysql from the restore all features it does not matter.

Is there a workaround to this bug. The only solution right now is to rename or delete the DB on the database server and restore from mysqldump which we do NOT want to do.

Thank You,

Eric

Discussion

  • Eric

    Eric - 2022-10-14

    Sorry I forgot to add presently running 7.0 Virtualmin on the new server.

     
  • Jamie Cameron

    Jamie Cameron - 2022-10-14

    Which command or page in the UI are you using to backup and restore the virtual server on the new system?

    Also, are you deleting it from the old system?

     
  • Eric

    Eric - 2022-10-15

    On current older server Using the backup virtual servers select one server via FTP it to new system this goes fine even deselecting mysql dbsOn new systemRestore virtual server from that archive file even if manually select features to restore minus mysqlError comes up because database is still on external db serverI have new server and old server have DB server as external servers If I delete the database from DB it will restore fineNo i dont want to delete off old server yet If the DB is a local DB all is fineIt just seems virtualmin doesn't realize u just want to restore a virtual server but DB should be ignored as it is on a external server not being changedThanks!!

     
  • Jamie Cameron

    Jamie Cameron - 2022-10-16

    When you're restoring on the remote system, try doing it via SSH with the command :

    virtualmin restore-domain --source /path/to/backup.tar.gz --all-domains --all-features --replication

    The --replication flag is what you want to ignore the existing MySQL DB ..

     
  • Eric

    Eric - 2022-10-17

    Hi Jamie,

    Thank you for your reply I just tried this

    virtualmin restore-domain --source /xxxx.com.tar.gz --all-domains --all-features --replication

    Checking for missing features ..
    .. all features in backup are supported

    Checking for errors in backup ..
    .. no errors found

    Starting restore..
    Extracting backup archive file ..
    .. done

    Re-creating virtual server XXXX.com ..
    .. the following warnings were detected :

    A MySQL database named XXXX already exists
    

    Restore failed!

    Do I need to skip warnings also?

    Thanks

     
  • Jamie Cameron

    Jamie Cameron - 2022-10-18

    Actually it looks like we don't properly support this use case yet :-( I'll do some work on it, and update this ticket with progress...

     
    • Eric

      Eric - 2022-10-18

      A possible work around instead of deleting the data off DB server.

      What if on old server we DEASSOCIATE MySQL for that virtual server

      Backup virtual server on OLD server

      Restore virtual server on NEW server

      This will then restore without Virtualmin knowing about MySQL.

      How do I RE-ASSOCIATE the MySQL for that virtual server on the NEW server.?

      Thanks

      Eric

       
      • Jamie Cameron

        Jamie Cameron - 2022-10-19

        Yeah, you can do this shell commands virtualmin disable-feature --domain example.com --mysql --disassociate and virtualmin enable-feature --domain example.com --mysql --associate

         
  • Eric

    Eric - 2022-10-19

    Thank you will the associate prompt for credentials and db details ?Since this is known already and DB exists on remote DBThanks

     
    • Jamie Cameron

      Jamie Cameron - 2022-10-19

      It should keep the existing credentials. But test this on a test domain first, just to be sure!

       
  • Eric

    Eric - 2022-10-19

    OK thank you but I am not sure how when restoring on a new server it would know this db stuff is this stored elsewhere in virtualmin.When you import virtual u specify the mysql DB and details etcThanks

     
    • Jamie Cameron

      Jamie Cameron - 2022-10-19

      The details of the DB should be stored in Virtualmin's domain config file, which will be copied across as part of the restore.

       
  • Eric

    Eric - 2022-10-21

    Thanks again for the help. The de-associate and re-associate as a great workaround to not having to remove the DB from the external servers.

    Thank You!

     
    • Jamie Cameron

      Jamie Cameron - 2022-10-22

      Great! Long-term we'll come up with a better solution to this, as it's a pretty common use-case.

       
  • Jamie Cameron

    Jamie Cameron - 2022-10-30
    • status: open --> closed-fixed
     
  • Jamie Cameron

    Jamie Cameron - 2022-10-30

    Ok, in the next Virtualmin release (7.4), this will no longer be an issue when restoring in "replication" mode.

     

Log in to post a comment.

MongoDB Logo MongoDB