从2.8.x升级¶
从2.7.x升级¶
从2.6.x升级¶
从2.4.x升级¶
以下是从2.4.x迁移到2.10.1的注意事项。当从2.6.x、2.7.x、2.8.x迁移时,这些注释也可能起作用,但在这些场景中没有进行测试。您应该在本地计算机上运行此过程,一旦成功迁移了数据库,就将备份移动到geonode2.10.1生产实例中。
《PostgreSQL》¶
为Django GeoNode 2.4创建角色和数据库:
create role user with superuser login with password '***';
create database gn_24 with owner user;
\c gn_24
create extension postgis;
从生产备份还原备份:
psql gn_24 < gn_24.sql
运行GeoNode迁移¶
激活GeoNode virtualenv并设置环境变量:
. env/bin/Activate
export vars_210
以下是要导出的变量-将它们更新到您的环境设置:
export DATABASE_URL=postgis://user:***@localhost:5432/dbname
export DEFAULT_BACKEND_DATASTORE=data
export GEODATABASE_URL=postgis://user:***@localhost:5432/geonode_data
export ALLOWED_HOSTS="['localhost', '192.168.100.10']"
export STATIC_ROOT=~/www/geonode/static/
export GEOSERVER_LOCATION=http://localhost:8080/geoserver/
export GEOSERVER_PUBLIC_LOCATION=http://localhost:8080/geoserver/
export GEOSERVER_ADMIN_PASSWORD=geoserver
export SESSION_EXPIRED_CONTROL_ENABLED=False
降级心理2:
pip install psycopg2==2.7.7
应用迁移和应用基本固定装置:
cd wfp-geonode
./manage.py migrate --fake-initial
paver sync
从头重新生成数据库中的上载应用程序表:
delete from django_migrations where app = 'upload';
drop table upload_upload cascade;
drop table upload_uploadfile;
使用migrate重新生成上载表:
./manage.py migrate upload
升级psycopg2:
pip install -r geonode/requirements.txt
创建超级用户¶
要创建超级用户,应删除以下约束(如果需要,可以重新启用这些约束):
alter table people_profile alter column last_login drop not null;
./manage createsuperuser
数据库上的修复¶
由于某些原因,一些资源未发布:
UPDATE base_resourcebase SET is_published = true;
从account_account中删除一个不再使用的外键(GeoNode dev团队:也许更好的做法是删除所有account表,我认为它们现在已经过时):
ALTER TABLE account_account DROP CONSTRAINT user_id_refs_id_726cb6b4;
ALTER TABLE account_signupcode DROP CONSTRAINT "inviter_id_refs_id_49a7c0d9";
通过运行以下脚本修复远程服务层:
python migration/fixes_remote_layers.py