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:
- Start new MSSQL docker instance
- Backup current MSSQL docker instance
- 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?