Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @agencia221b,

    I hope you are doing well today!

    You can try the following code snippet as mu-plugin which you can import submissions from the exported CSV file.
    https://gist.github.com/wpmudev-sls/c388628c027364aa866e4d1c329f5b5d

    CSV file should be uploaded to the /wp-content/uploads directory?and both Form ID and filename variables should be changed to your requirements.

    You can find more information below on how to use mu-plugins.
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    It is better to test this out on your staging/dev site first before performing the action on your live site and make sure you have the latest backups.

    Kind regards,
    Zafer

    Thread Starter Agencia 221B

    (@agencia221b)

    Hi there, Zafer!

    Thanks for your answer.

    I’ve tried this snippet, but without success. In my first post I made a reference to that solution, but it didn’t work for me. And the error log didn’t register any error. I just don’t know why it didn’t work

    I would just ask if that is the only solution right now for this issue, or if there is something else I could try.

    Kind regards,

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    hi @agencia221b

    Thank you for response!

    There is still no built-in import but I just tested this code (the one that Zafer shared with you) and it actually worked fine. There are some things to make sure of, though, so I’d like to ask you to give it one more try but this time let me guide you step-by-step through it:

    First, you need to make sure that the form into which you want to import submissions is exactly the same as the source one; if it’s within the same site – you may create duplicate; if it’s on a different site – you may import the form; but the point is it needs to have all the same fields – exactly the same.

    Note down the ID of that new (target) form; form ID is the number you see in form shortcode.

    Now let me share exactly what I did next on my end:

    1. I exported submissions to a CSV file from the original form and saved it on my local drive. Then for the ease of use I renamed the CSV file to “entry-import.csv”.

    2. I uploaded that file to the “/wp-content/uploads” folder on the site into which I wanted to import entries.

    3. then I create an empty file with a .php extension (“form-entry-import.php”) in the “/wp-content/mu-plugins” folder; again – on the site into which I wanted to import entries.

    4. I copies entire code from here

    https://gist.githubusercontent.com/wpmudev-sls/c388628c027364aa866e4d1c329f5b5d/raw/2578ce59fdff46f9f3d4fa24a2baf949cc3a901b/forminator-import-submissions.php

    into that file and before saving it, made following changes

    a) in this line

    $form_id = 7;

    I replaced 7 with an ID of my target (the one I was importing to) form ID

    b) in this line

    $csv_filename = "forminator-simple-contact-form-211019093636";

    I replaced “forminator-simple-contact-form-211019093636” with “entry-import” (as I named the file in step 1;note that actual file has CSV extension but I didn’t use it here; it’s important!)

    Then I saved that file.

    5. Then, being logged-in as admin, I visited “https://mysite.com/wp-admin/index.php?import_submissions=true” (where mysite.com was of course replaced with a real address of my test site).

    Once the page loaded I checked submissions for that new form and all were there – imported as expected.

    I think it’d be worth giving another shot just to make sure – but be sure to follow above steps exactly, especially if it comes to the use of filename and the location of the CSV file.

    Best regards,
    Adam

    Thread Starter Agencia 221B

    (@agencia221b)

    Flawlessly!

    Now worked perfectly.

    The first time I’ve tried I did all the steps you put here now, except the 5. That one did the job!

    I had a small problem with the submission date/time of the submissions, though:

    But I noticed that the date format in the destination wordpress config is different than the origin wordpress. Maybe that was the problem. Would be nice if you had an answer for this date issue, but I will do more tests matching the date format to troubleshoot. But for now this is not a problem for what I need, that you already solved!

    Thank you guys so much, better support on the wordpress community!

    Thread Starter Agencia 221B

    (@agencia221b)

    Just an update: I tried again matching the wordpress config date format but nothing changed. The error of the submissions date/time wrong after the import continues.

    Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @agencia221b

    Hope you’re doing well today!

    I tried to replicate the date/time issue on my lab site but was not able to replicate it. Both of my sites are using UTC +0 timezone, and I exported the submissions from Testsite A and imported them to Testsite B using the exact steps mentioned in our previous response.

    However, the date/time remained the same for those imported submissions. It seems that the issue could be related to the server time probably, but I cannot be sure as yet.

    Could you please confirm if your form on the target site already had any previous submissions? This will help us to replicate the issue with exact scenario and check further.

    Kind Regards,
    Saurabh

    Thread Starter Agencia 221B

    (@agencia221b)

    Hi Saurabh!

    I made the import two times, in one it had one previous submission, the second time didn’t have any previous submissions.

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hello @agencia221b,

    Thank you for the details.

    Could you please send the exported form and submissions to us for further troubleshooting. Please email them at [email protected] with subject: ATTN: WPMU DEV support – wp.org

    Please attach the files to your email, and also include the link back to this thread for the reference: https://www.ads-software.com/support/topic/is-it-possible-to-import-submission/

    Best Regards,
    Dmytro

    Thread Starter Agencia 221B

    (@agencia221b)

    Hi Dmytro.

    Done, email sent right now.

    Thanks!

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @agencia221b

    We haven’t heard from you in a while in our both conversations, I’ll go and mark this thread as resolved. If you have any additional questions or require further help, please let us know!

    Kind Regards,
    Kris

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Is it possible to import submission?’ is closed to new replies.