My Import doesn't works: The Export run great. But the Custom User Fields not imported. why?
What can i do?
$start = microtime(true);
echo " skipping user fields";
//Map any custom user feilds you have here. Disabled by default.
// exec('mysql -h' . $this->slaveDbHost . ' ' . $this->sourceDb . ' ' . $this->sourceDBuser . ' ' . $this->sourceDBpassword . ' -N -q -e "SET NAMES binary;SELECT SQL_NO_CACHE userid AS user_id, \'interests\' AS field_id, field3 AS field_value FROM userfield WHERE field3 != \'\' ORDER BY userid" ' . self::$extraOutCommand . ' > ' . self::$dataDir . 'xf_user_field_value.txt');
// exec('mysql -h' . $this->slaveDbHost . ' ' . $this->sourceDb . ' ' . $this->sourceDBuser . ' ' . $this->sourceDBpassword . ' -N -q -e "SET NAMES binary;SELECT SQL_NO_CACHE userid AS user_id, \'twitter\' AS field_id, field14 AS field_value FROM userfield WHERE field14 != \'\' ORDER BY userid" ' . self::$extraOutCommand . ' >> ' . self::$dataDir . 'xf_user_field_value.txt');
// exec('mysql -h' . $this->slaveDbHost . ' ' . $this->sourceDb . ' ' . $this->sourceDBuser . ' ' . $this->sourceDBpassword . ' -N -q -e "SET NAMES binary;SELECT SQL_NO_CACHE userid AS user_id, \'last_bump_date\' AS field_id, field17 AS field_value FROM userfield WHERE field17 > 0 ORDER BY userid" ' . self::$extraOutCommand . ' >> ' . self::$dataDir . 'xf_user_field_value.txt');
// exec('mysql -h' . $this->slaveDbHost . ' ' . $this->sourceDb . ' ' . $this->sourceDBuser . ' ' . $this->sourceDBpassword . ' -N -q -e "SET NAMES binary;SELECT SQL_NO_CACHE userid AS user_id, \'icq\' AS field_id, icq AS field_value FROM user WHERE icq != \'\' ORDER BY userid" ' . self::$extraOutCommand . ' >> ' . self::$dataDir . 'xf_user_field_value.txt');
// exec('mysql -h' . $this->slaveDbHost . ' ' . $this->sourceDb . ' ' . $this->sourceDBuser . ' ' . $this->sourceDBpassword . ' -N -q -e "SET NAMES binary;SELECT SQL_NO_CACHE userid AS user_id, \'aim\' AS field_id, aim AS field_value FROM user WHERE aim != \'\' ORDER BY userid" ' . self::$extraOutCommand . ' >> ' . self::$dataDir . 'xf_user_field_value.txt');
// exec('mysql -h' . $this->slaveDbHost . ' ' . $this->sourceDb . ' ' . $this->sourceDBuser . ' ' . $this->sourceDBpassword . ' -N -q -e "SET NAMES binary;SELECT SQL_NO_CACHE userid AS user_id, \'yahoo\' AS field_id, yahoo AS field_value FROM user WHERE yahoo != \'\' ORDER BY userid" ' . self::$extraOutCommand . ' >> ' . self::$dataDir . 'xf_user_field_value.txt');
// exec('mysql -h' . $this->slaveDbHost . ' ' . $this->sourceDb . ' ' . $this->sourceDBuser . ' ' . $this->sourceDBpassword . ' -N -q -e "SET NAMES binary;SELECT SQL_NO_CACHE userid AS user_id, \'skype\' AS field_id, skype AS field_value FROM user WHERE skype != \'\' ORDER BY userid" ' . self::$extraOutCommand . ' >> ' . self::$dataDir . 'xf_user_field_value.txt');
// exec('mysql -h' . $this->slaveDbHost . ' ' . $this->sourceDb . ' ' . $this->sourceDBuser . ' ' . $this->sourceDBpassword . ' -N -q -e "SET NAMES binary;SELECT SQL_NO_CACHE userid AS user_id, \'msn\' AS field_id, msn AS field_value FROM user WHERE msn != \'\' ORDER BY userid" ' . self::$extraOutCommand . ' >> ' . self::$dataDir . 'xf_user_field_value.txt');
Just a quickie about the custom user fields. We have one that's a checkbox. I've set up the target XenForo userfield as a dropdown list with Yes or No choices only.
How do I modify one of the above lines to accept a checked box (I believe the vb table stores a value of 1) into XenForo as a Yes.....and an unchecked (else) a No. (It's a required user field). Thanks
exec('mysql -h' . $this->slaveDbHost . ' ' . $this->sourceDb . ' ' . $this->sourceDBuser . ' ' . $this->sourceDBpassword . ' -N -q -e "SET NAMES binary;SELECT SQL_NO_CACHE userid AS user_id, \'interests\' AS field_id, IF(field3 = 1, 'Yes', 'No') AS field_value AS field_value FROM userfield WHERE field3 != \'\' ORDER BY userid" ' . self::$extraOutCommand . ' > ' . self::$dataDir . 'xf_user_field_value.txt');
exec('mysql -h' . $this->slaveDbHost . ' ' . $this->sourceDb . ' ' . $this->sourceDBuser . ' ' . $this->sourceDBpassword . ' -N -q -e "SET NAMES binary;SELECT SQL_NO_CACHE userid AS user_id, \'xenforofieldname\' AS field_id, IF(field5 = 1, \'Yes\', \'No\') AS field_value FROM userfield ORDER BY userid" ' . self::$extraOutCommand . ' >> ' . self::$dataDir . 'xf_user_field_value.txt');
exporting posts...
postsERROR 1146 (42S02) at line 1: Table 'gamerz_vbtestsite.post' doesn't exist
rm: cannot remove `/home/gamerz/public_html/demo/importData/xf_post_*': No such file or directory
(0 records in 0.01s)...
post IPsERROR 1146 (42S02) at line 1: Table 'gamerz_vbtestsite.post' doesn't exist
(0 records in 0.01s)...
reputation as likesERROR 1146 (42S02) at line 1: Table 'gamerz_vbtestsite.reputation' doesn't exist
(0 records in 0.01s)...
reported postsERROR 1146 (42S02) at line 1: Table 'gamerz_vbtestsite.thread' doesn't exist
(0 records in 0.01s)...
reported post commentsERROR 1146 (42S02) at line 1: Table 'gamerz_vbtestsite.thread' doesn't exist
(0 records in 0.01s)...
reported profile postsERROR 1146 (42S02) at line 1: Table 'gamerz_vbtestsite.thread' doesn't exist
(0 records in 0.01s)...
reported profile post commentsERROR 1146 (42S02) at line 1: Table 'gamerz_vbtestsite.thread' doesn't exist
(0 records in 0.01s)...
reported private messagesERROR 1146 (42S02) at line 1: Table 'gamerz_vbtestsite.thread' doesn't exist
(0 records in 0.01s)...
reported private message commentsERROR 1146 (42S02) at line 1: Table 'gamerz_vbtestsite.thread' doesn't exist
(0 records in 0.01s)...
post edit historyERROR 1146 (42S02) at line 1: Table 'gamerz_vbtestsite.postedithistory' doesn't exist
(0 records in 0.01s)...
Total time for posts: 0.10s
root@server [~]#
Make Selection [1-9]: 2
exporting users...
user & user authenticate
An exception occurred: Mysqli prepare error: SELECT command denied to user 'gamerz_xenadm'@'localhost' for table 'user' in /home/gamerz/public_html/demo/library/Zend/Db/Statement/Mysqli.php on line 77
#0 /home/gamerz/public_html/demo/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('??????SELECT us...')
#1 /home/gamerz/public_html/demo/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '??????SELECT us...')
#2 /home/gamerz/public_html/demo/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('??????SELECT us...')
#3 /home/gamerz/public_html/demo/library/Zend/Db/Adapter/Abstract.php(734): Zend_Db_Adapter_Abstract->query('??????SELECT us...', Array)
#4 /home/gamerz/public_html/demo/Export.php(325): Zend_Db_Adapter_Abstract->fetchAll('??????SELECT us...')
#5 /home/gamerz/public_html/demo/Export.php(1853): DigitalPointExporter->users()
#6 {main}
@Marcel, thanks, that worked perfect.
@Slavik or @Jake Bunce I have posts working, but now I get this error when doing users.
What have I done wrong?
Probably not applied to all tables.
Log into mysql via ssh and run
grant all privileges on *.* to gamerz_xenadm@localhost;
Query OK, 0 rows affected (0.00 sec)
Now when I do it again, I get:
2
exporting users...
user & user authenticateroot@server [~]#
Not in the error log I looked at. Which error log should I be looking at?anything show up in the error log?
Not in the error log I looked at. Which error log should I be looking at?
What folder is it in, because I can't find it.The xenforo one.
What folder is it in, because I can't find it.
No errors have been logged.In the admin cp > tools > server error log
We use essential cookies to make this site work, and optional cookies to enhance your experience.