I need to move a test SharePoint 2010 site collection and database to a new server (and new database). I want to make sure that I keep user security and all document versions. Does backup/restore keep all document versions automatically, or do I need to use import/export with the -includeusersecurity and -versions syntax?
Backup-SPSite will move all your data and rights and create corresponding records in the content DB.
Import-Export is not so good way for you, you can use it only for web, not for site collection, but it also will move all your data and security, if you will set corresponding flags, it has a lot of options. Previous approach is also possible, you can attach your content DB to the new location, it will move all your data and security, but I use
Backup-SPSite most often.
The way I would do this is to move the site collection into its own content database. Then copy that database and attach it to the new farm.
- In Central Admin add a new content database to the web application
- Use the Move-SPSite CMDLET in PowerShell to move the site collection to the new content database
- Make a SQL backup of the content database
- Restore the SQL backup to the SQL server of the new farm
- Attach the content database to a web application on the new farm