It is dockerized utility that allows to copy database schema and data between two servers SQL Servers
It does not require sysadmin
permissions, user only need to have GRANT
-ed permission for database CONTROL
.
Please read my question on stackoverflow: HERE
If you know other soultion give me a message!
Source\Target | 2016 SP2 | 2019 |
---|---|---|
2016 SP2 | Yes | Yes |
*2019 | No | Yes |
https://hub.docker.com/repository/docker/mjpolak/sqlservercp
- It uses sqlpackage to make
dacpac
containg schema of source database. - It uses bcp to save all source tables data.
- Then, it try to publish schema via [sqlpackage] to target database, removing all non existing objects on target, and objects that are blocking migration. (All
sqlpackage
properties
can be checked execute.sh) - All data are removed from target tables.
- Then bcp is used to bulk insert all data.
Image require to fill enviroment variables:
SOURCE_DB_HOST
= Source hostSOURCE_DB_NAME
= Source database nameSOURCE_DB_PASSWORD
= Source user passwordSOURCE_DB_USER
= Source user nameSOURCE_DB_PORT
= Source db portTARGET_DB_HOST
= Target hostTARGET_DB_NAME
= Target database nameTARGET_DB_PASSWORD
= Target user passwordTARGET_DB_USER
= Target userTARGET_DB_PORT
= Target port
Easies way of running util is to copy environment config .env_template
, fill all varaibles, save it as .env
.
Then just execute docker-compose up