You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
root@djrad2 /opt/djrad# ./manage.py dbrestore -i /opt/gdrive/datadjrad/default-postgresql-2018-10-17-063622.psql
System check identified some issues:
WARNINGS:
hotspot.HsRadCSI.afterauth: (fields.W122) 'max_length' is ignored when used with IntegerField
HINT: Remove 'max_length' from field
hotspot.HsRadClient.afterauth: (fields.W122) 'max_length' is ignored when used with IntegerField
HINT: Remove 'max_length' from field
hotspot.HsUser.user: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
Restoring backup for database 'default' and server 'None'
Restoring: /opt/gdrive/datadjrad/default-postgresql-2018-10-17-063622.psql
Restore tempfile created: 8.0 MiB
Are you sure you want to continue? [Y/n] Y
Traceback (most recent call last):
File "./manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/dbbackup/management/commands/dbrestore.py", line 54, in handle
self._restore_backup()
File "/usr/local/lib/python2.7/dist-packages/dbbackup/management/commands/dbrestore.py", line 94, in _restore_backup
self.connector.restore_dump(input_file)
File "/usr/local/lib/python2.7/dist-packages/dbbackup/db/base.py", line 90, in restore_dump
result = self._restore_dump(dump)
File "/usr/local/lib/python2.7/dist-packages/dbbackup/db/postgresql.py", line 54, in _restore_dump
stdout, stderr = self.run_command(cmd, stdin=dump, env=self.restore_env)
File "/usr/local/lib/python2.7/dist-packages/dbbackup/db/postgresql.py", line 21, in run_command
return super(PgDumpConnector, self).run_command(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/dbbackup/db/base.py", line 144, in run_command
"Error running: {}\n{}".format(command, stderr.read()))
dbbackup.db.exceptions.CommandConnectorError: Error running: psql djrad --host=localhost --username=djrad --no-password --set ON_ERROR_STOP=on --single-transaction
ERROR: constraint "hotspot_hsradcs_radclient_id_d673b456_fk_hotspot_hsradclient_id" of relation "hotspot_hsradcsi" does not exist
I do crosscheck using psql from shell, and got that "hotspot_hsradcsi" is already there.
djrad=> \dt;
********* QUERY **********
SELECT n.nspname as "Schema",
c.relname as "Name",
CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 's' THEN 'special' WHEN 'f' THEN 'foreign table' END as "Type",
pg_catalog.pg_get_userbyid(c.relowner) as "Owner"
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('r','')
AND n.nspname <> 'pg_catalog'
AND n.nspname <> 'information_schema'
AND n.nspname !~ '^pg_toast'
AND pg_catalog.pg_table_is_visible(c.oid)
ORDER BY 1,2;
**************************
List of relations
Schema | Name | Type | Owner
--------+----------------------------+-------+-------
public | auth_group | table | djrad
public | auth_group_permissions | table | djrad
public | auth_permission | table | djrad
public | auth_user | table | djrad
public | auth_user_groups | table | djrad
public | auth_user_user_permissions | table | djrad
public | django_admin_log | table | djrad
public | django_content_type | table | djrad
public | django_migrations | table | djrad
public | django_session | table | djrad
public | hotspot_hsaccounting | table | djrad
public | hotspot_hsgroup | table | djrad
public | hotspot_hsknownmac | table | djrad
public | hotspot_hslease | table | djrad
public | hotspot_hspool | table | djrad
public | hotspot_hsportal | table | djrad
public | hotspot_hsradclient | table | djrad
public | hotspot_hsradcsi | table | djrad
public | hotspot_hsstation | table | djrad
public | hotspot_hsuser | table | djrad
public | hotspot_hsuserdevice | table | djrad
(21 rows)
Dear All ...
I tried to restore from a backup file
I do crosscheck using psql from shell, and got that "hotspot_hsradcsi" is already there.
And here is database part my settings.py
The text was updated successfully, but these errors were encountered: