<div dir="ltr"><div><div>Thanks Tom, I just opened an issue[1].<br><br></div>Now, getting back to my problem of getting the metadata from one GeoNode server to another. What would be the best option? I tried downloading the XML and putting it along with the shapefile since I'd rather not have to fill 100+ metadata records by hand.<br><br>What about the migration scripts from afabiani. Will that move both the data (vector data in postgis or imagens in GeoServer) along with the metadata?<br><br></div><div>Cheers<br></div><div>Daniel<br><br>[1] <a href="https://github.com/GeoNode/geonode/issues/2469">https://github.com/GeoNode/geonode/issues/2469</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 12, 2016 at 5:27 PM, Tom Kralidis <span dir="ltr"><<a href="mailto:tomkralidis@gmail.com" target="_blank">tomkralidis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Apr 12, 2016 at 12:39 PM, Daniel Victoria<br>
<<a href="mailto:daniel.victoria@gmail.com">daniel.victoria@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I'm trying to populate a new geonode instance (v2.4) with some shapefiles<br>
> from another geonode (v2.4).<br>
><br>
> I have all the shapefiles in a directory so I'm inclined to use the<br>
> importlayers command. And to make things easier, I've downloaded the<br>
> metadata (ISO format, XML file) from the former geonode and placed it with<br>
> the shapefiles that will be imported.<br>
><br>
> The importlayers command fails with the following message<br>
><br>
> ./par_a01_2013_inventoryplotsubplot.shp<br>
> ================<br>
> Traceback (most recent call last):<br>
> File "/usr/local/lib/python2.7/dist-packages/geonode/layers/utils.py",<br>
> line 588, in upload<br>
> title=title<br>
> File "/usr/local/lib/python2.7/dist-packages/geonode/layers/utils.py",<br>
> line 429, in file_upload<br>
> vals, regions, keywords = set_metadata(xml_file.read())<br>
> File "/usr/local/lib/python2.7/dist-packages/geonode/layers/metadata.py",<br>
> line 62, in set_metadata<br>
> vals, regions, keywords = dc2dict(exml)<br>
> File "/usr/local/lib/python2.7/dist-packages/geonode/layers/metadata.py",<br>
> line 198, in dc2dict<br>
> vals['date'] = sniff_date(mdata.modified)<br>
> File "/usr/local/lib/python2.7/dist-packages/geonode/layers/metadata.py",<br>
> line 222, in sniff_date<br>
> return datetime.datetime.strptime(datestr.strip(), dfmt)<br>
> AttributeError: 'NoneType' object has no attribute 'strip'<br>
><br>
> If I remove the XML file from the shapefile directory, the importlayers<br>
> command works OK.<br>
><br>
> Any idea what is wrong? Attached is the offending metadata file, just in<br>
> case.<br>
> Cheers<br>
> Daniel<br>
<br>
</div></div>Daniel: looks like missing metadata. Having said this, we should have a more<br>
graceful error. If you can open a GitHub issue [1], I will fix.<br>
<br>
Thanks<br>
<br>
..Tom<br>
<br>
[1] <a href="https://github.com/GeoNode/geonode/issues/new" rel="noreferrer" target="_blank">https://github.com/GeoNode/geonode/issues/new</a><br>
</blockquote></div><br></div>