WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Multisite query issues after importing sites (11 posts)

  1. charliebrimm
    Member
    Posted 1 year ago #

    We are using multisites and I am moving sites from single installs into the network. On the blogs that I am importing I am geting errors with every page load and there is a strange "N" showing up in the query. WordPress 3.4.1. SQL server using the database abstraction plugin. Sites that were NOT imported are not giving this error.

    Part of the error:

    INSERT INTO sh_13_options (option_name, option_value, autoload) VALUES
    ( N'rewrite_rules',  N'a:75:{s:19:"sitemap_index\.xml$";s:19:"index.php?
    sitemap=1";s:31:"([^/]+?)-sitemap([0-9]+)?\.xml

    This is only part of the error since it is long. See the N's? aldo the table name sh_13_options seems like it is being merged with the column name.

    The query (only a portion) some items are repeating:

    INSERT INTO sh_13_options (option_name, option_value, autoload) VALUES
    ( N'rewrite_rules',
    N'a:75:{s:19:"sitemap_index\.xml$";s:19:"index.php?sitemap=1";s:31:"([^/
    ]+?)-sitemap([0-9]+)?\.xml$";s:51:"index.php?sitemap=$matches[1]&sitemap
    _n=$matches[2]";s:47:"category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$";s
    :52:"index.php?category_name=$matches[1]&feed=$matches[2]";s:42:"categor
    y/(.+?)/(feed|rdf|rss|rss2|atom)/?$";s:52:"index.php?category_name=$matc
    hes[1]&feed=$matches[2]";s:35:"category/(.+?)/page/?([0-9]{1,})/?$";s:53
    :"index.php?category_name=$matches[1]&paged=$matches[2]";...i:2;s:88:"[Microsoft][SQL Server Native
    Client 10.0][SQL Server]The statement has been
    terminated.";s:7:"message";s:88:"[Microsoft][SQL Server Native Client
    10.0][SQL Server]The statement has been terminated.";}}
  2. How did you import these?

  3. charliebrimm
    Member
    Posted 1 year ago #

    I used the import/export tool but had to break up the files because they were not importing properly. It appears after some searching a few minutes again that the N is what makes sql handle nvarchar which probably isn't the issue at this point.

    Still the blogs that were not imported are not having this particular error which is thrown every time a page loads. I reset permalinks to no avail.

  4. charliebrimm
    Member
    Posted 1 year ago #

    [Microsoft][SQL Server Native Client 10.0][SQL Server]Violation of UNIQUE KEY constraint '<strong>sh_13_options_option_name</strong>'. Cannot insert duplicate key in object 'dbo.sh_13_options'.";s:7:"message";s:176:"[Microsoft][SQL Server Native Client 10.0][SQL Server]Violation of UNIQUE KEY constraint 'sh_13_options_option_name'. Cannot insert duplicate key in object 'dbo.sh_13_options'.";}i:1;a:6:{i:0;s:5:"01000";s:8:"SQLSTATE";s:5:"01000";i:1;i:3621;s:4:"code";i:3621;i:2;s:88:"[Microsoft][SQL Server Native Client 10.0][SQL Server]The statement has been terminated.";
    s:7:"message";s:88:"[Microsoft][SQL Server Native Client 10.0][SQL Server]The statement has been terminated.";}}

    I also noticed that while importing posts there were several that had video embeds that made it into the export but were stripped when imported.

  5. How did you break up the files?

  6. charliebrimm
    Member
    Posted 1 year ago #

    Just removed items by hand. Leaving the headers and everything in place I would grab about 2000 lines at a time and paste in and import taking care not to break the xml.

  7. Hm. Okay, that wasn't the best way to do it (and may be why you've got weirdness).

    Normally when it's too big, you should export less at a time - like one category at a time.

  8. charliebrimm
    Member
    Posted 1 year ago #

    I will have to try that approach for the others, but it is too late for these. They way I was doing it also seemed like the only way to have the images stay attached to the posts. The blogs imported were around 100 posts with right around 1mb for the import file and would never actually complete and change the img urls in posts etc...

    Anyway I still have this issue and am looking for the fix. This one query on rewrite rules fires constantly which isn't normal and it fails every time for every blog. It is the only major repetitive error. There are others the occur occasionally and I'll tackle those, but cannot figure this one out.

    Thanks.

  9. They way I was doing it also seemed like the only way to have the images stay attached to the posts.

    No, not really. Any import will bring in post images if you check the box, but 1MB should not have been 'too big.' So something else is going on there...

    What kind of SQL server are you running?

  10. charliebrimm
    Member
    Posted 1 year ago #

    SQL Server 2008. If I imported batches of posts with their corresponding attachments the images remained attached. The images were over 100 mb and the transfer from the previous host seemed to be the slow part and the import would time out.

    Anyway I have the issue I have now so I hae to fix it. Do you have any ideas or suggestions of what might be causing this?

  11. charliebrimm
    Member
    Posted 1 year ago #

    Turns out after several times of setting permalinks to default, hitting the blog, setting them back to the desired structure and hitting the blog again fixed the problem. I discovered this only after deleting all content, menus, cats, everything from a test import and the problem was still there.

    I had reset permalinks several times without hitting the blog after to no avail.

Topic Closed

This topic has been closed to new replies.

About this Topic