Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Database Backup doesn't contain Docker feeds?



  • I have been using proget for quite a while and it's overdue for an upgrade due to various bugs that have been fixed in newer versions, and while I'm at it I would like to upgrade to MSSQL database instance from 2017 to 2022. My thought process is that this would be:

    1. Start new MSSQL docker instance
    2. Backup current MSSQL docker instance
    3. Start new proget docker instance pointed at the new database

    However, I find when I do this the docker feed has vanished according to the newly spun up proget instance. Is there a step I am missing. This is the command I used to backup from MSSQL 2017:

    (I tried both of the following):

    docker exec -it proget-sql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $(cat mssql-pass.txt) -Q "BACKUP DATABASE [ProGet] TO DISK = N'/var/opt/mssql/backup/backup.bak' WITH FORMAT"
    docker exec -it proget-sql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $(cat mssql-pass.txt) -Q "BACKUP DATABASE [ProGet] TO DISK = N'/var/opt/mssql/backup/backup.bak' WITH NOFORMAT, NOINIT, NAME = 'ProGet-full', SKIP, NOREWIND, NOUNLOAD, STATS = 10"

    Then after copying out of docker and into the new docker instance, I restore the new instance:

    (I tried both of the following)
    docker exec -it proget-sql-2022 /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $(cat mssql-pass.txt) -Q 'RESTORE DATABASE ProGet FROM DISK = "/var/opt/mssql/backup/backup.bak" WITH FILE = 1, NOUNLOAD, STATS = 10'
    docker exec -it proget-sql-2022 /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $(cat mssql-pass.txt) -Q 'RESTORE DATABASE ProGet FROM DISK = "/var/opt/mssql/backup/backup.bak" WITH MOVE "ProGet" TO "/var/opt/mssql/data/ProGet.mdf", MOVE "ProGet_log" TO "/var/opt/mssql/data/ProGet_log.ldf"'

    Either way, the docker feed is missing when the new instance is spun up. Is there any way to resolve this?



  • Gosh sorry, I actually forgot to copy the new backup before trying again so the result is that the second variant of these backup and restore do not work (I took these from an older version of the documentation) but the first variants do (these are in the current docs)


  • inedo-engineer

    @jim-borden_4965 glad you got it working :)

    On Windows, you can just do an in-place upgrade of MSSQL, and not worry about database migrations. The same is probably true on Docker, and you can just upgrade container.

    Anyways safer to back-up.

    And if you haven't seen it already, here is the ProGet guidance:
    https://docs.inedo.com/docs/installation-backing-up-restoring


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation