If no new database is given, the default datase of the mapset is used as
printed by db.connect -g
. If no old database is given, all
layers without a link in the new database will be liniked to the new
database. If an old database is given, only links in the old database
will be changed.
Optionally attribute tables in new_database can be created if not exist by -c flag. In this case v.db.reconnect.all also tries to create an index on key column (usually "cat" column).
v.db.connect -g
.
v.db.connect -g map=census 1/census|census|cat|/home/user/grassdata/nc_spm_base/PERMANENT/dbf/|dbf
/home/user/grassdata/nc_spm_base/PERMANENT/dbf/
can
be also defined as '$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
(see examples).
Attribute tables from old_database are after reconnecting left untouched. v.db.reconnect.all deletes those tables automatically only when -d flag is given.
Also note that v.db.reconnect.all doesn't change default
database driver or database (db.connect -p
). Default database
connection settings for newly created attribute data can be defined
by db.connect.
v.db.reconnect.all old_database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' \ new_driver=sqlite new_database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'
v.db.reconnect.all -c old_database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' \ new_driver=sqlite new_database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'
# set default connection (sqlite) db.connect -d # verify default connection db.connect -g # reconnect v.db.reconnect.all -c old_database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
# first rebuild topology for all vector maps v.build.all # set new default db connection (to SQLite default) db.connect -d # copy attribute tables from old DB to new SQLite DB, delete old tables in DBF format v.db.reconnect.all -cd