Import question

Permalink Browser Info Environment
Hi,
I ran an import with 360 records but without thinking I put it on immediate instead of cron job. Now its stopped after 10 minutes and importing 191 records (they are smallish entries). Is it possible to re-start the import? I believe that if I choose the same file and import it again that it it will create duplicates of the 190 done so far.
Best
Phil

Type: Pre-Sale
Status: Resolved
PhilYoung
View Replies:
InformaticsInc replied on at Permalink Reply
InformaticsInc
Hi PhilYong,

To continue from the last record that was imported, you can go to System & Settings > Automated Jobs and Run the "Staff Directory Import".
This should import the remaining items.

We would suggest that you make a database backup of your site before running the Import job just as a precautionary measure.

Thanks,
Informatics Inc
PhilYoung replied on at Permalink Reply
PhilYoung
I thought that would be the case, but there is no such entry in the jobs list? I just have the below. I notice no number 10 or 11 entry

12 Fill thumbnail database table Never
13 Deactivate Users Never
3 Check Automated Groups Apr 18, 2018, 6:50:08 PM Active users updated.
4 Generate the sitemap.xml file Apr 18, 2018, 6:50:10 PM /sitemap.xml file saved (166 pages).
5 Process Email Posts Apr 18, 2018, 6:50:12 PM The Job was run successfully.
6 Remove Old Page Versions Apr 18, 2018, 6:50:15 PM 3 versions deleted from 113 pages (3)
7 Update Gatherings Apr 18, 2018, 6:50:25 PM The Job was run successfully.
8 Update Statistics Trackers Apr 18, 2018, 6:50:32 PM The Job was run successfully.
9 HonestWebsites Store Geocode Aug 3, 2018, 5:25:15 PM The Job was run successfully.
2 Index Search Engine - All Aug 22, 2018, 10:08:01 PM Index performed on: 678 pages, 2 users, 342 files, and 1 site
1 Index Search Engine - Updates Aug 22, 2018, 10:09:30 PM Index performed on: 0 pages, 2 users, 342 files, and 1 site
InformaticsInc replied on at Permalink Reply
InformaticsInc
Hi PhilYoung,

Thanks for sharing your jobs list. We are not sure why the "Staff Directory Import" job is missing from your list.
Any chance it got deleted?

Restoring the job would allow you to run it and continue importing. However the recommended way to do that is via sql.

Do you have access to your database and feel comfortable running a mysql query to add the "Staff Directory Import" job back?

Let us know and we can provide you a script that you can run.
We will likely need the installed Staff Directory pkgID from the Jobs table to provide the script.

Thanks,
Informatics Inc
PhilYoung replied on at Permalink Reply
PhilYoung
Hi,

I don't think it got deleted - the import froze and i suspect it never got written as after 10 minutes of the site being frozen I had to cancel import.

The packages table in the db shows the pkgID as 18

Thanks for your support with this. I can run the script you provide.

Best
Phil
InformaticsInc replied on at Permalink Reply 1 Attachment
InformaticsInc
Hi Phil,

Please find attached the sql query you need to run to add the job.

We would suggest that you make a database backup of your site before running the query/ Import job just as a precautionary measure.

Thanks,
Informatics Inc
PhilYoung replied on at Permalink Reply
PhilYoung
Hi,

I ran the sql command and i now have staff directory in the jobs list but when I run it i get the message below

Staff Directory Import Aug 28, 2018, 9:30:15 PM array_combine(): Both parameters should have an equal number of elements

Best
Phil
InformaticsInc replied on at Permalink Reply
InformaticsInc
Hi Phil,

Please send us the csv file via a Private Message. We will take a look.

Thanks,
Informatics Inc
PhilYoung replied on at Permalink Reply
PhilYoung
Hi,
Being based in Europe and subject to stringent GDPR regulations. I cant send you the csv. I assume the error message indicates an issue with one of the fields in the csv which, of course, may be why the import stalled after 191 lines and the job never got written. There does not seem to be an order to the import from the csv (unless you know the sequence?) which makes creating an abbreviated file a bit problematic but I can quickly eliminate about 120 that were imported from the 191. That will mean I get some duplicates from a new import but I can weed them out manually fairly quickly.

I have studied the csv and it looks fine. Would the import stall with an entry that had a foreign text character that rendered like this "Grażyna" as a first name? Actually there a few of those in some addresses too.

Thanks as always for your great support

Best
Phil
PhilYoung replied on at Permalink Reply
PhilYoung
Here is an oddity on my installation.

i can import a file with 10 entries on immediate and it runs fine. If I try and do it using the same file but using a cron job it gives the same error message

array_combine(): Both parameters should have an equal number of elements
and the log says

Exception Occurred: /home/polarity/public_html/polarityeducation.net/packages/staff_directory/single_pages/dashboard/directory_extended/directory_import/view.php:265 Invalid argument supplied for foreach() (2)

So its not an issue with the csv...
InformaticsInc replied on at Permalink Reply
InformaticsInc
Hi Phil,

We reviewed the foreign text character, and it does not break the import.

Since we can't review the csv file, our best targeted guess, is that there may be at least one record that has a comma(,) in the field. Since this is a comma separated file, that would break the import.

Can you verify if your csv file contains any commas?

Regarding the chron job, the code is set up to return to the file in queue when you start the import again. Meaning, it will reference to the file you initially uploaded, and re-running it would return the same error. Thus, even if you've fixed something in the csv you're attempting to import, it'll still error on the first file.

To help determine & provide options, can you let us know what are the updates/steps that you have taken so far?

1) Did you delete any imported pages from the site map?
2) Did you run another import using a new import file?

Thanks,
Informatics Inc
PhilYoung replied on at Permalink Reply
PhilYoung
Hi,
I have no idea why the original large import broke but I uploaded a new file with 250 records (just a truncated version of the original) late last night and it went well the whole import took about 25 minutes and then it took me about 20 minutes to delete the duplicated imports.

So the full import is now done.

I think your package is more fault tolerant than you indicate. Today, I cleared the sql table of all the imports and I can upload a file with multiple commas in the address field and it does not break the import either as immediate or as a cron job.

Thanks for your help. In spite of my issue and delay the import is complete and has saved me hours and hours of manual copy and paste of some 380 records.

Perhaps in a future update you could make it possible to delete more than one record at a time as I can imagine some scenarios where this would be very helpful.

Staff directory is still one of the best c5 packages!
Best wishes
Phil
InformaticsInc replied on at Permalink Reply
InformaticsInc
Thanks for the kind words Phil! Always a pleasure.

Let us know if you need anything else!

- Informatics Inc.

concrete5 Environment Information

# concrete5 Version
Core Version - 8.4.2
Version Installed - 8.4.2
Database Version - 20180716000000

# concrete5 Packages
Cloneamental (0.9.3), Honest Websites Back To Top (1.0.1), HonestWebsites Store location (1.4.0), List files from set (1.0.13), Login/Logout Link (1.0), Login Block (0.9.3), Login Dialog (0.9.7), Login Page Background (0.9), Mega Menu (1.6.2.2), Pixel Theme (2.1.0), Seren (1.0.5), Simple Gallery (1.0.7), Staff Directory (1.1.2), Tallacmans Tasty Templates (1.0)

# concrete5 Overrides
None

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
LiteSpeed

# Server API
litespeed

# PHP Version
5.6.37

# PHP Extensions
bcmath, bz2, calendar, Core, ctype, curl, date, dom, enchant, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, intl, ionCube Loader, json, libxml, litespeed, mbstring, mcrypt, mhash, mysql, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_sqlite, pgsql, Phar, posix, pspell, readline, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, sqlite3, standard, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend Guard Loader, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 90
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - -1
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
sql.safe_mode - Off
upload_max_filesize - 16M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 2000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5
zend_optimizerplus.max_accelerated_files - 2000
zend_optimizerplus.max_file_size - 0
zend_optimizerplus.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.