Comments on: migrating application databases with dbatools https://dbatools.io/migrating-application-dbs/ the community's sql powershell module Tue, 22 Oct 2019 21:10:40 +0000 hourly 1 https://wordpress.org/?v=5.3.4 By: Rocky https://dbatools.io/migrating-application-dbs/#comment-75922 Tue, 22 Oct 2019 21:10:40 +0000 https://dbatools.io/?p=7289#comment-75922 Is there a way for the command to use the credential that I give it instead of the service account for the backup/restore?

Unfortunately, our systems are so segregated they don’t share directories, nor do they share a service account. Since I am trying to copy databases in the same environment I have access with my DBA credentials, but they don’t seem to be used anywhere I need them to be used (aka the file system to access the .bak).

I was surprised it was using the service account not the one I provided for -DestinationSqlCredential/-SourceSqlCredential

Here is the warning:
WARNING: [15:48:47][Test-DbaBackupInformation] Backup File \\SERVERA\backup$\A_DB_201910221548-2-of-3.bak cannot
be read by SERVERB. Does the service account (TSTDOMAIN\SERVERBSVCACCT) have permission?

]]>
By: jeff_yao https://dbatools.io/migrating-application-dbs/#comment-72203 Mon, 19 Aug 2019 22:21:36 +0000 https://dbatools.io/?p=7289#comment-72203 This is a very good function, but one question, if my destination db needs to be a different folder (from the source db folder), is this doable?
An example is:
source db: X_DB, two files d:\data\x.mdf and e:\log\x.ldf

want to restore to destination db as follows
destination db: Y_DB, two files M:\data\x.mdf and N:\log\x.ldf

is this doable? (also assume M:\Data\ and N:\Log\ are NOT the default db paths at the destination server side)

]]>
By: Gareth https://dbatools.io/migrating-application-dbs/#comment-71986 Thu, 15 Aug 2019 11:06:25 +0000 https://dbatools.io/?p=7289#comment-71986 Hi Michael,

You can’t backup and restore from new to old, as you have discovered. The only way to do that would be as you say moving data. dbatools can help you with this, it has commands to copy table data and generate scripts. Copy-DbaDbTableData, Export-DbaScript. Or if you have an older compatible backup you could restore that (then maybe merge everything). BUT – it sounds like you have your database on a newer version of SQL now, can’t you just keep it there?

If for some reason you want to keep new and old, can’t think why but who knows. You could use SQL server replication to keep the old server in sync with the new server (assuming its not more than 2 versions older, I think it’s 2 version max jump for replication)

Good Luck!

]]>
By: Michael Beck https://dbatools.io/migrating-application-dbs/#comment-71137 Tue, 13 Aug 2019 20:37:53 +0000 https://dbatools.io/?p=7289#comment-71137 Hi Jess,

These tools are fabulous. Thanks for all of the hard work of you and your team.

I’m trying to migrate a database from a newer SQL server to an older one. Unfortunately, I don’t have the option to change the version of SQL server in use.

When I attempt to do a restoration of the backup, I get an error saying that it’s incompatible. Is there a way around this short if using a script to call through each table and copy everything row for row?

Michael

]]>
By: Jess https://dbatools.io/migrating-application-dbs/#comment-70047 Thu, 08 Aug 2019 12:31:38 +0000 https://dbatools.io/?p=7289#comment-70047 Hey Todd,
Glad you are using dbatools for that process! For bring production data down to non-prod I would use something similar to this process, you could also look at `Invoke-DbaDbDataMasking` to mask any sensitive data (https://docs.dbatools.io/#Invoke-DbaDbDataMasking). There is also a post on scheduling dbatools scripts that might help if you wanted to run it automagically https://dbatools.io/agent/.
Thanks for stopping by,
Jess

]]>
By: Todd https://dbatools.io/migrating-application-dbs/#comment-70029 Wed, 07 Aug 2019 23:49:33 +0000 https://dbatools.io/?p=7289#comment-70029 Hi,

I’ve just begun the process of migrating / consolidating our many instances on 2 new clusters with dbatools as my goto tool.

I have one case where developers want to bring a prod database down to stage and dev on a regular basis, copying over the existing databases each time. Can you recommend a process using dbatools?

]]>
By: T-SQL Tuesday #102 – Giving Back – Jess Pomfret https://dbatools.io/migrating-application-dbs/#comment-4210 Wed, 09 May 2018 00:57:35 +0000 https://dbatools.io/?p=7289#comment-4210 […] of this year and so far have managed four posts, including this one and one guest post on the dbatools blog.  My goal for the year is to have 10 posts on this blog, so I have 6 left to write.  My aim is to […]

]]>
By: T-SQL Tuesday #101 – The Multitool of my DBA toolbox – Jess Pomfret https://dbatools.io/migrating-application-dbs/#comment-1676 Tue, 10 Apr 2018 12:07:14 +0000 https://dbatools.io/?p=7289#comment-1676 […] a backup/restore method or by detaching and re-attaching the files. Check out my post on the dbatools blog for a more detailed look on how I used this to save a lot of time on a recent project at […]

]]>
By: Database Migration With dbatools – Curated SQL https://dbatools.io/migrating-application-dbs/#comment-1557 Fri, 16 Mar 2018 12:05:35 +0000 https://dbatools.io/?p=7289#comment-1557 […] Jess Pomfret shows how easy it is to migrate databases from one SQL Server instance to another using…: […]

]]>