stsadm -o enumsites -url http://<servername&gt; –databasename WSS_Content_1 > sites.xml

stsadm -o mergecontentdbs -url http://<servername&gt; -sourcedatabasename WSS_Content_1 -destinationdatabasename WSS_Content_2 -operation 3 -filename sites.xml