I have an existing SharePoint 2010 site. I am going to start doing some development but want to take a copy of live onto dev so I can develop against that. Is there a way I can do it. If I could automate it that would be great. So i can do the same in the future as production gets out of sync.
Do you physically have a development environment and a production environment, or are they just separate web applications?
In environments where you have two separate environments I usually use the content database to copy production back to dev. Ask your admin/DBA to copy the content database from production to dev, and add that content DB to the environment.
You can also take the approach of making a site backup or export using STSADM or PowerShell and restoring it to the other URL in dev.
You should backup the content database from production and restore it on your dev server.
Note: You'll need a web application to restore the content database to. Here are the simple steps if you're using SQL Server to do the backup/restore:
- Backup the content database using SQL Server Management Studio
- Restore the database on your dev SQL Server using SQL Server Management Studio
- Create a new web application on your dev server
- Remove its content database
- Add the content database into the newly created web application using stsadm addcontentdb or Powershell Mount-SPContentDatabase