Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export import script is broken #8105

Closed
JeGoi opened this issue Apr 26, 2024 · 3 comments · Fixed by #8106 or #8193
Closed

export import script is broken #8105

JeGoi opened this issue Apr 26, 2024 · 3 comments · Fixed by #8106 or #8193

Comments

@JeGoi
Copy link
Contributor

JeGoi commented Apr 26, 2024

Describe the bug
This PR #7754 has probably broken the import script since this one is based on /usr/local/pf and this PR pushed everything on ./

To Reproduce

  1. Do the backup script
  2. Extract the file
  3. See that it is directly in ./ and no more under usr/local/pf

Expected behavior
Fix backup file OR fix the import script

Additional context
Add any other context about the problem here.

@JeGoi JeGoi added this to the PacketFence-13.2 milestone Apr 26, 2024
@JeGoi JeGoi self-assigned this Apr 26, 2024
@JeGoi JeGoi mentioned this issue Apr 26, 2024
@JeGoi
Copy link
Contributor Author

JeGoi commented May 2, 2024

Still broken. import from deb13.1 to el813.2

/usr/local/pf/addons/full-import/import.sh -f /root/export_24_may_2.tgz 
/tmp/tmp.Kkkon20yLo ~
=================================================================================
Extracting archive...
Found the following content in the archive:
total 336480
-rw-r--r--. 1 root root       519 May  2 12:35 add_files.txt
-rw-r--r--. 1 root root      1083 May  2 12:35 grants.sql
-rw-r--r--. 1 root root     77288 May  2 04:30 packetfence-db-dump-2024-05-02_00h30.sql.gz
-rw-r--r--. 1 root root 172842068 May  2 04:30 packetfence-files-dump-2024-05-02_00h30.tgz
-rw-r--r--. 1 root root      1630 May  2 12:35 stored_config_files.txt
drwxr-xr-x. 3 root root      4096 May  2 12:35 usr
=================================================================================
Found files dump 'packetfence-files-dump-2024-05-02_00h30.tgz'
Extracting files dump
=================================================================================
Found compressed database dump 'packetfence-db-dump-2024-05-02_00h30.sql.gz'
Uncompressed database dump 'packetfence-db-dump-2024-05-02_00h30.sql'
=================================================================================
Get PF version in PacketFence export
13.1.0
=================================================================================
Stopping PacketFence services
=================================================================================
The database dump uses mysqldump
---------------------------------------------------------------------------------
Recreating database pf
---------------------------------------------------------------------------------
Dump file was made without triggers and procedures
Importing bare schema for 13.1
---------------------------------------------------------------------------------
Replacing create statements from the dump and removing drop statements
---------------------------------------------------------------------------------
Importing packetfence-db-dump-2024-05-02_00h30.sql into pf
ERROR 1062 (23000) at line 1214: Duplicate entry '1' for key 'PRIMARY'
Cleaning temporary directory
[root@139-144-196-10 ~]

It looks like a tenant issue...

@JeGoi JeGoi reopened this May 2, 2024
@JeGoi JeGoi assigned satkunas and unassigned JeGoi May 2, 2024
@satkunas satkunas closed this as completed May 7, 2024
@satkunas satkunas reopened this Jun 25, 2024
@satkunas satkunas added this to the +1 (patch release) milestone Jun 25, 2024
@JeGoi
Copy link
Contributor Author

JeGoi commented Jun 25, 2024

The fix #8106 is only working from 13.1 to 13.2.
I confirm that it causes an issue with import from previous version of PF.

@JeGoi
Copy link
Contributor Author

JeGoi commented Jun 25, 2024

root@172-234-130-112:~# /usr/local/pf/addons/full-import/import.sh -f /tmp/export.tgz
/tmp/tmp.cZTZCAwkNA ~
=================================================================================
Extracting archive...
Found the following content in the archive:
total 199100
-rw-r--r-- 1 root root       519 Jun 25 16:24 add_files.txt
-rw-r--r-- 1 root root      1083 Jun 25 16:24 grants.sql
-rw-r--r-- 1 root root    107499 Jun 25 16:15 packetfence-db-dump-2024-06-25_12h15.sql.gz
-rw-r--r-- 1 root root 102269720 Jun 25 16:15 packetfence-files-dump-2024-06-25_12h14.tgz
-rw-r--r-- 1 root root      1640 Jun 25 16:24 stored_config_files.txt
drwxr-xr-x 3 root root      4096 Jun 25 16:24 usr
=================================================================================
Found files dump 'packetfence-files-dump-2024-06-25_12h14.tgz'
Extracting files dump
Your version is comming from packetfence < 13.2
=================================================================================
Found compressed database dump 'packetfence-db-dump-2024-06-25_12h15.sql.gz'
Uncompressed database dump 'packetfence-db-dump-2024-06-25_12h15.sql'
=================================================================================
Get PF version in PacketFence export
12.2.0
=================================================================================
Stopping PacketFence services
Synchronizing state of monit.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable monit

So, I found a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment