wiki:backuppc_mssql
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| wiki:backuppc_mssql [2015/06/02 18:30] – created jrdalrymple | wiki:backuppc_mssql [2018/09/27 02:29] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| ==== What you'll need ==== | ==== What you'll need ==== | ||
| + | |||
| + | * Working BackupPC installation | ||
| + | * SQL server account with sa-like privs - we'll create a more restricted backup user | ||
| + | * Unprivileged account on domain or local to server for backuppc user | ||
| + | * You have to have [[wiki: | ||
| + | |||
| + | ==== The SQL Permissions ==== | ||
| + | |||
| + | - Open SQL Server Management Studio - connect to the DB Engine in question as a SA or some such | ||
| + | - Drill into your Database engine' | ||
| + | - In the Login - New dialogue fill in the Login name field with your Windows user account, use the Search... dialogue to make things simple. This can be a local or domain user. That's the only field that needs to be filled in, click OK. | ||
| + | - In the Databases folder, expand each Database you want to back up (often there is only 1), expand the Security folder within, right-click Users and click New User... | ||
| + | - Fill in User name and Login name with the information from step 3, in the Membership section check db_backupoperator, | ||
| + | - Repeat steps 4 & 5 for all databases if you want to backup more than one | ||
| + | - Now is a good time to make a specific note of all the database names you want to back up, the database name is the actual text adjacent to the cylindrical shape, this will be used in the next section | ||
| + | |||
| + | ==== The folder and scripts ==== | ||
| + | |||
| + | - Create a folder somewhere on the server, I use a folder called " | ||
| + | - Change the permissions to be very restrictive on that folder, only the unprivileged windows user **and the user that is running the SQL service** (find in services.msc) need access. | ||
| + | - We need 2 files in that folder\\ <file DOS backup_dbs.cmd> | ||
| + | erase " | ||
| + | sqlcmd -E -i " | ||
| + | BACKUP DATABASE [DATABASE_1] TO DISK = N' | ||
| + | BACKUP DATABASE [DATABASE_2] TO DISK = N' | ||
| + | GO</ | ||
| + | |||
| + | ==== The parts on the BackupPC server ==== | ||
| + | |||
| + | - The user on your BackupPC server that is running the daemon needs to be able to login to the Windows host without a password, you can ID this user with `ps -ef | grep " | ||
| + | - If you haven' | ||
| + | - su backuppc | ||
| + | - ssh-keygen | ||
| + | - cat .ssh/ | ||
| + | - exit | ||
| + | - copy the contents of the backuppc user's id_rsa.pub file into the file " | ||
| + | - su backuppc | ||
| + | - ssh windowsuser@windowshost (yes, then password for that user) | ||
| + | - mkdir .ssh | ||
| + | - vi .ssh/ | ||
| + | - chmod 600 .ssh/ | ||
| + | - chmod 700 .ssh | ||
| + | - exit | ||
| + | - At this point you should be able to ssh into the windows host as backuppc user without entering a password | ||
| + | - Create a host just like any other Windows host on your BackupPC server, you may as well configure this server to only do Full backups since really every backup will be full anyway using this method | ||
| + | - Configure your DumpPreUserCmd to be the following: " | ||
| + | |||
| + | ==== Conclusion ==== | ||
| + | |||
| + | That should be it, you should get backups. Just that easy - if it doesn' | ||
wiki/backuppc_mssql.1433269832.txt.gz · Last modified: 2018/09/27 02:30 (external edit)