I would like to copy whole content of database: schema & data between two SQL Server servers via a scrip, preferably embedded in linux docker image.
Copy would be used on test environment for testing purposes.
I have few constraints:
- I’m able to able to reach DBs selected via sqlcmd protocol.
- I don’t have access to files on servers
- I would like to execut script from linux
What solutions I discarded:
- Backup (bak) files as I don’t have file access.
- Bacpac – as according to docs i don’t have necessary permissions.
What i think may work but is seems over engineered:
- Use sqlpackage to create DAC file as it is available on linux.
- Use dac to update structure on target database
- Use bcp from Mssql Tools to copy data.
Solution could fail when because of update of structure failure.
Is there any other option which i overlooked?
Or better idea?
I’v implemented solution as described above( sqlpackage + bcp ) and dockerized it HERE, all on linux.
Still, looking for better approach.