Sorry to contradict, but neither will work. The change of the datastore is accepted (tried it in Geoserver 2,1,3) but all layers are not working because the layers underneath are not changed and fail with an error.
The second approach will not work full stop. Here is why: You've got a namespace.xml like the one below <namespace> <id>NamespaceInfoImpl--*6bae35c6:1389775ae97:-7ffe*</id> <prefix>geocat</prefix> <uri>http://land.vic.gov.au/geocat</uri> </namespace> You've got a datastore.xml like the one below: <dataStore> <id>DataStoreInfoImpl--*503e43db:13a006672f6:-7fff*</id> <name>engine2_SDE_geocat</name> <description>engine2_SDE_geocat</description> <type>ArcSDE</type> <enabled>true</enabled> <workspace> <id>WorkspaceInfoImpl--/6bae35c6:1389775ae97:-7fff/</id> </workspace> ........................... both have IDs, which you will find again in the featuretype.xml of your layer. <featureType> <id>FeatureTypeInfoImpl-6d507638:13a005ea3a2:-7ffd</id> <name>VMADD.ADDRESS</name> <nativeName>VMADD.ADDRESS</nativeName> <namespace> <id>NamespaceInfoImpl--*6bae35c6:1389775ae97:-7ffe*</id> </namespace> .............. layerdef.............. </metadata> <store class="dataStore"> <id>DataStoreInfoImpl--*503e43db:13a006672f6:-7fff*</id> </store> <maxFeatures>0</maxFeatures> <numDecimals>0</numDecimals> </featureType> These two in the featuretype.xml need to conform to the ids in the namespace.xml and the datastore.xml. You need to change both to conform to you new datastore and/or namespace. Warning; One error and your entire datastore is buggered!!! ----- ____________________________ Dr Christian Maul Project Manager Information Services Branch Department of Sustainability and Environment Level13, Marland House, 570 Bourke Street Melbourne 3000 PO Box 500, East Melbourne Vic 3002 Telephone: +61-3-8636 2325 Telefax: +61-3-8636 2813 -- View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-change-workspace-of-existing-layers-tp5004193p5004468.html Sent from the GeoServer - User mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users