copy all database instance to another sql server dbatools

  • Dear all,
    I tried to move several databases from one instance to anotherI used the dbatools Copy-DbaDatabase tool
     Copy-DbaDatabase -Source Server1 -Destination server2 -Database datbase1 -NetworkShare \\server1\backup -BackupRestore

    I just had this error
    Select-Object : Property "MB Free" cannot be found.At line:197 char:93+ ... Substring(0, 1) } | Select-Object 'MB Free' -ExpandProperty 'MB Free'+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo    : InvalidArgument: (System.Data.DataRow:PSObject) [Select-Object], PSArgumentException  + FullyQualifiedErrorId : ExpandPropertyNotFound,Microsoft.PowerShell.Commands.SelectObjectCommand

    Who can help me please on the root cause of this error


  • Why don't you use the backup and restore from MS Management Studio?
    https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/restore-a-database-backup-using-ssms

  • Or back up and restore from T-SQL?

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Backup and restore is the best.

    Next to that, if you can afford to stop the first SQL instance, copying the database files and do a 'attach' will work just as well.

    But why are you copying the databases? Would you need to copy over security logins as well?

    How often do you need to do this?

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply