[GeoNode-users] Copy part of the layers in a geonode instance

Alessio Fabiani alessio.fabiani at geo-solutions.it
Wed Feb 24 05:57:41 PST 2016


Using the following command from geonode folder will allow you to dump the
whole DB

python manage.py dumpdata --natural --indent=2 --exclude=contenttypes
--exclude=sessions.Session > dump.json

If you want to dump only the Layers you can use something like

python manage.py dumpdata --natural --indent=2 --exclude=contenttypes
--exclude=sessions.Session layers > layers.json




Best Regards,
Alessio Fabiani.

==
GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information.
==

Ing. Alessio Fabiani
@alfa7691
Founder/Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:     +39 0584 1660272
mob:   +39 331 6233686

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

---------------------------------------------------------------------

On Wed, Feb 24, 2016 at 2:52 PM, Daniel Victoria <daniel.victoria at gmail.com>
wrote:

> Hi Alessio,
>
> Good to know this export/import feature is being investigated. Will be a
> nice addition. As for your suggestion, where can I get the layers JSon?
> Directily from the database? I'm more of a user than a developer.
>
> Thanks
> Daneil
>
> On Wed, Feb 24, 2016 at 8:15 AM, Alessio Fabiani <
> alessio.fabiani at geo-solutions.it> wrote:
>
>> Dear Daniel,
>> as part of the Backup&Restore procedure I am investigating a way to
>> export/import part of the GeoNode data.
>>
>> WARNING: All this work is in progress, so at this time there is nothing
>> ready to use.
>>
>> The idea is the following one:
>>
>> 1. Providing to the user a management command to backup the GeoNode
>> catalog. The whole catalog or part of it.
>>
>> - This will make use of the "fixtures" and there should be a way to
>> provide somehow a query or a list of keys to store a subset of the layers.
>> - Backup the GeoServer data.
>>
>> 2. Providing to the user a management command to restore the GeoNode
>> catalog. The whole catalog or part of it.
>>
>> - The command will use saved fixtures to restore GeoNode data.
>> - Restore the GeoServer data.
>>
>>
>> As a first implementation there will be the possibility to save the whole
>> catalog as a set of Json fixtures.
>>
>> For you specific use case, the possibility would be to take the Layers
>> JSON and preserve "only" the layers you want to restore.
>>
>> On GeoServer side you will need to get the layers data manually. This is
>> possible simply by getting the files from the GEOSERVER_DATA_DIRECTORY:
>>
>>  - Get the saved shapefiles from the upload subfolder
>>  - Get the catalog metadata from workspace/geonode subfolder
>>  - Get the styles SLDs and XMLs from styles subfolder
>>  - Reload the catalog from the admin interface or restart GeoServer.
>>
>>
>> Best Regards,
>> Alessio Fabiani.
>>
>> ==
>> GeoServer Professional Services from the experts!
>> Visit http://goo.gl/it488V for more information.
>> ==
>>
>> Ing. Alessio Fabiani
>> @alfa7691
>> Founder/Technical Lead
>>
>> GeoSolutions S.A.S.
>> Via di Montramito 3/A
>> 55054  Massarosa (LU)
>> Italy
>> phone: +39 0584 962313
>> fax:     +39 0584 1660272
>> mob:   +39 331 6233686
>>
>> http://www.geo-solutions.it
>> http://twitter.com/geosolutions_it
>>
>> -------------------------------------------------------
>>
>> *AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
>>
>> Le informazioni contenute in questo messaggio di posta elettronica e/o
>> nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
>> loro utilizzo è consentito esclusivamente al destinatario del messaggio,
>> per le finalità indicate nel messaggio stesso. Qualora riceviate questo
>> messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
>> darcene notizia via e-mail e di procedere alla distruzione del messaggio
>> stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
>> divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
>> utilizzarlo per finalità diverse, costituisce comportamento contrario ai
>> principi dettati dal D.Lgs. 196/2003.
>>
>>
>>
>> The information in this message and/or attachments, is intended solely
>> for the attention and use of the named addressee(s) and may be confidential
>> or proprietary in nature or covered by the provisions of privacy act
>> (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
>> Code).Any use not in accord with its purpose, any disclosure, reproduction,
>> copying, distribution, or either dissemination, either whole or partial, is
>> strictly forbidden except previous formal approval of the named
>> addressee(s). If you are not the intended recipient, please contact
>> immediately the sender by telephone, fax or e-mail and delete the
>> information in this message that has been received in error. The sender
>> does not give any warranty or accept liability as the content, accuracy or
>> completeness of sent messages and accepts no responsibility  for changes
>> made after they were sent or for other risks which arise as a result of
>> e-mail transmission, viruses, etc.
>>
>> ---------------------------------------------------------------------
>>
>> On Tue, Feb 23, 2016 at 8:44 PM, Daniel Victoria <
>> daniel.victoria at gmail.com> wrote:
>>
>>> We have a GeoNode instance with more than 1000 layers published. We'd
>>> like to have a seccond GeoNode site with only some of the layers published
>>> in the first site, around 100. So far we've though of two ways to do this:
>>> 1) install a clean GeoNode and manually register the 100 layers
>>> 2) Copy the GeoNode with 1000 layers and manually delete the 900 excess
>>> layers
>>>
>>> The first option sound better, specially if we use the importlayers
>>> command. But can I import the metadata with the importlayers commad?
>>>
>>> Are there any other options?
>>>
>>> Thanks
>>> Daniel
>>>
>>> _______________________________________________
>>> geonode-users mailing list
>>> geonode-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/geonode-users
>>>
>>>
>>
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geonode-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20160224/68639741/attachment.html>


More information about the geonode-users mailing list