Mysqldump allows you to specify which table(s) to dump, or conversely to dump 
all tables and exclude some (--ignore-table).

Off the top of my head I would at least dump the node, node_category and person 
tables.

It's also possible to select only some of the data to be dumped with the 
--where option.
See man mysqldump for the gory details. 

What I would do : 
Install new PF and go through the configurator to create the database and pf 
user with the proper permissions.
in mysql, on the new server, "drop database pf".
in mysql, on the new server, "create database pf" (will create a new empty 
database).
Run a "mysqldump -R --no-data pf > nodata_dump.sql" on the old server (will 
create a copy of the existing database schema).
Dump the data you want to preserve:  "mysqldump [options] pf table1 table2 
table3 > dump.sql"
Import that dump into the new server "mysql pf < nodata_dump.sql" (will 
recreate the tables from your old server)
Import the data that you exported:  "mysql pf < dump.sql"
Run all the upgrade scripts, in order, from 6.2 to 7.2 as mentioned in 
UPGRADE.ascii:  
                eg. "mysql pf < db/upgrade-6.2.0-6.3.0.sql ;  mysql pf < 
db/upgrade-6.3.0-6.4.0.sql" 
                and so on.


That should ensure your database schema is consistent.

Personally though, I feel it's much easier to just import everything (perhaps 
excluding the accounting and archives tables) and then just prune the data in 
place on the new server.
You can check what you are about to delete before doing it. 
So I usually replace step 5 above with just 

# mysqldump pf --ignore-table=pf.radacct --ignore-table=pf.radacct_log 
--ignore-table=pf.ip4log_archive --ignore-table=pf.locationlog_archive 
--ignore-table=pf.radius_audit_log > pf_dump.sql

Hope this helps,
--
Louis Munro
[email protected] <mailto:[email protected]>  ::  www.inverse.ca 
<http://www.inverse.ca/> 
+1.514.447.4918 x125  :: +1 (866) 353-6153 x125
Inverse inc. :: Leaders behind SOGo (www.sogo.nu <http://www.sogo.nu/>) and 
PacketFence (www.packetfence.org <http://www.packetfence.org/>)

> On Aug 2, 2017, at 10:32, Rossing, Will via PacketFence-users 
> <[email protected]> wrote:
> 
> Hey Louis, 
> 
> Thanks for the reply,  Only because I saw the import-node-csv.pl 
> <http://import-node-csv.pl/>  script.   Also, I  would be able to clean the 
> data up a little before importing on the new server.
> 
> I am all ears If it makes more sense to use mysqldump  - any tips for 
> import/export process for just the nodes table with that command?
> 
> Thanks again 
> 
> Will
> 
> >>>
> Louis Munro via PacketFence-users Wed, 02 Aug 2017 06:55:06 -0700
> 
> Why a CSV?
> A myslqdump would preserve the data and be much easier to reimport.
> 
> 
> 
> On Wed, Aug 2, 2017 at 6:15 AM, Rossing, Will <[email protected] 
> <mailto:[email protected]>> wrote:
> >
> > Hello,
> >
> > Upgrading from 6.2 to 7.2 and decided to do clean install and import 
> > currently registered nodes.  Can someone tell me the most simple way to 
> > export from 6.2 into a csv that I can import into 7.2?
> >
> > Thank you!
> >
> > will
> >
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! 
> http://sdm.link/slashdot_______________________________________________
> PacketFence-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/packetfence-users

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users

Reply via email to