Since @hgtonight said the import script will unzip,
you could look in the unzipped file and see if it properly unzips manually. If the file will not unzip then you have a problem with the export process itself.
if it does unzip manually ,look at tables produced. (perhaps a problem with import process).
and maybe manually install tables if they look properly formed.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Well, I turned off compression and got a proper text file, but I'm still getting the annoying can't parse error. Is there a log to check somewhere? Something with more information about what can't be parsed?
I'm using the Vanilla Import page in the dashboard to import. I've tried removing the first two lines, and it doesn't work. The importer seems to need, especially, the first line, to know how to proceed.
This seems to be the code generating the error, from applications/dashboard/models/class.importmodel.php @ Line 1256:
while (($Line = fgets($fpin)) !== FALSE) {
$LineNumber++;
if ($Line == "\n") {
if ($fpout) {
// We are in a table so close it off.
fclose($fpout);
$fpout = 0;
}
} elseif ($fpout) {
// We are in a table so dump the line.
fputs($fpout, $Line);
} elseif (substr_compare(self::COMMENT, $Line, 0, strlen(self::COMMENT)) == 0) {
// This is a comment line so do nothing.
} else {
// This is the start of a table.
$TableInfo = $this->ParseInfoLine($Line);
if (!array_key_exists('Table', $TableInfo)) {
throw new Gdn_UserException(sprintf(T('Could not parse import file. The problem is near line %s.'), $LineNumber));
}
$Table = $TableInfo['Table'];
$Path = dirname($Path).DS.$Table.'.txt';
$fpout = fopen($Path, 'wb');
$TableInfo['Path'] = $Path;
unset($TableInfo['Table']);
// Get the column headers from the next line.
if (($Line = fgets($fpin)) !== FALSE) {
$LineNumber++;
// Strip \r out of line.
$Line = str_replace(array("\r\n", "\r"), array("\n", "\n"), $Line);
fwrite($fpout, $Line);
$Columns = $this->ParseInfoLine($Line);
$TableInfo['Columns'] = $Columns;
$Tables[$Table] = $TableInfo;
}
}
}
It seems clear from the contents of $TableInfo what the problem is. The code in this section is analyzing the contents of different lines, like so:
if ($Line == "\n") {
if ($fpout) {
// We are in a table so close it off.
fclose($fpout);
$fpout = 0;
}
} elseif ($fpout) {
// We are in a table so dump the line.
fputs($fpout, $Line);
} elseif (substr_compare(self::COMMENT, $Line, 0, strlen(self::COMMENT)) == 0) {
// This is a comment line so do nothing.
} else {
// This is the start of a table.
$TableInfo = $this->ParseInfoLine($Line);
...
But then when it parses that line, it's not at a table definition, which is in fact 3 lines down in the file. But I'm not sure how this should be corrected. It strikes me as a sort of fundamental error. But I've probably misunderstood things here...
Comments
That looks like a gzipped file, no?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight, that's very possibly the explanation! Perhaps I didn't unzip it the right way. Will try that out...
The import script will ungzip files sent to it. I just can't read gzipped files unless they are a complete file.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Since @hgtonight said the import script will unzip,
you could look in the unzipped file and see if it properly unzips manually. If the file will not unzip then you have a problem with the export process itself.
if it does unzip manually ,look at tables produced. (perhaps a problem with import process).
and maybe manually install tables if they look properly formed.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
you could turnoff compression here
line 1864 could try setting to NULL and looking at output file or removing the TRUE
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Well, I turned off compression and got a proper text file, but I'm still getting the annoying can't parse error. Is there a log to check somewhere? Something with more information about what can't be parsed?
now do a head on the text file or
post the line where where the parse errors occur.
I assume you are getting parse error on import
don;t know about log - you would need to search the code.
I don't know how porter imports. or do you just import via phpmyadmin.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
The message says that the line happens "near" Line 1. Here's the first five lines:
can you post about 30 lines or 50 lines.
I am taking a wild guess but you could remove the first 2 lines.
how are you importing.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
head --lines 30 yourfilename
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
That error comes straight from the Vanilla source. Save screenshots of the error for posting here.
Then look in the Vanilla source for that message so you can find out the reason you get that error
There was an error rendering this rich post.
I'm a bit hesitant to post more of the db. It starts off immediately then with all the users. Each line looks like this:
1,"admin","","@asfdf.net"
and so on.
I'm using the Vanilla Import page in the dashboard to import. I've tried removing the first two lines, and it doesn't work. The importer seems to need, especially, the first line, to know how to proceed.
@underdog - how does one import using vanillaporter is it automatically imported after export.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
screenshot of error:
This seems to be the code generating the error, from applications/dashboard/models/class.importmodel.php @ Line 1256:
change it to this - and post results.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
The results:
I guess the importer is not handline this first line in the correct way...?
also search for
ParseInfoLine routine.
this is what it is doing
you could debug this loop.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
It seems clear from the contents of $TableInfo what the problem is. The code in this section is analyzing the contents of different lines, like so:
But then when it parses that line, it's not at a table definition, which is in fact 3 lines down in the file. But I'm not sure how this should be corrected. It strikes me as a sort of fundamental error. But I've probably misunderstood things here...
well at least you know how to proceed as laborious as it might be.
you can either correct output file
just remove bad lines - until you get good lines,
or correct import model to match ouput file - more trouble than its worth.
I would choose to put export file in a readable format for import to work in a text editor.
Take one table at a time.
or load it into a spreadsheet export as csv and use phpmyadmin.
too bad lincoln doesn't pop up.
I gotta go.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.