Migration: How to preserve serial length
-
Hello
When I migrate my website to my localhost then I use notepad++ to modified my .sql file.
Example find https://oldname and replace http://newname, working fine.
Next I import my .sql file. All is running fine, exceptI loss my widget_text information, see below.
I find out that the data has a serial length counter build in, example
s:15:“About This Site”
Where s:15 is the length of the data…QST Is there a option in Notepad++ to preserve (modified automatically )
Thx Robert Poland
(79, ‘widget_text’, ‘a:5:{i:2;a:4:{s:5:“title”;s:7:“Find Us”;s:4:“text”;s:168:“<strong>Address</strong>\n123 Main Street\nNew York, NY 10001\n\n<strong>Hours</strong>\nMonday—Friday: 9:00AM–5:00PM\nSaturday & Sunday: 11:00AM–3:00PM”;s:6:“filter”;b:1;s:6:“visual”;b:1;}i:3;a:4:{s:5:“title”;s:15:“About This Site”;s:4:“text”;s:85:“This may be a good place to introduce yourself and your site or include some credits.”;s:6:“filter”;b:1;s:6:“visual”;b:1;}i:4;a:4:{s:5:“title”;s:7:“Find Us”;s:4:“text”;s:168:“<strong>Address</strong>\n123 Main Street\nNew York, NY 10001\n\n<strong>Hours</strong>\nMonday—Friday: 9:00AM–5:00PM\nSaturday & Sunday: 11:00AM–3:00PM”;s:6:“filter”;b:1;s:6:“visual”;b:1;}i:5;a:4:{s:5:“title”;s:15:“About This Site”;s:4:“text”;s:85:“This may be a good place to introduce yourself and your site or include some credits.”;s:6:“filter”;b:1;s:6:“visual”;b:1;}s:12:“_multiwidget”;i:1;}’, ‘yes’),
-
@R-van-Wingerden said:
Is there a option in Notepad++ to preserve
I’m not sure what you’re trying to preserve, or what you think Notepad++ didn’t preserve for you.
If you only changed
https://oldname
tohttps://newname
, then nothing else should have changed. However, if youroldname
ornewname
were not literally those, but included regex characters, and you had enabled regular expression search/replace mode, then that might explain things.But so far, I don’t see that you’ve given us enough information.
-----
Please Read
FYI:
This forum is formatted using Markdown, with a help link buried on the little grey
?
in the COMPOSE window/pane when writing your post. For more about how to use Markdown in this forum, please see @Scott-Sumner’s post in the “how to markdown code on this forum” topic, and my updates near the end. It is very important that you use these formatting tips – using single backtick marks around small snippets, and using code-quoting for pasting multiple lines from your example data files – because otherwise, the forum will change normal quotes (""
) to curly “smart” quotes (“”
), will change hyphens to dashes, will sometimes hide asterisks (or if your text isc:\folder\*.txt
, it will show up asc:\folder*.txt
, missing the backslash). If you want to clearly communicate your text data to us, you need to properly format it. That topic also explains how to embed images by uploading them to a public server like imgur.com, and embedding them using the syntax![](http://i.imgur.com/QTHZysa.png)
If you have further search-and-replace (“matching”, “marking”, “bookmarking”, regular expression, “regex”) needs, study this FAQ and the documentation it points to. Before asking a new regex question, understand that for future requests, many of us will expect you to show what data you have (exactly), what data you want (exactly), what regex you already tried (to show that you’re showing effort), why you thought that regex would work (to prove it wasn’t just something randomly typed), and what data you’re getting with an explanation of why that result is wrong. When you show that effort, you’ll see us bend over backward to get things working for you. If you need help formatting, see the paragraph above.
Please note that for all regex and related queries, it is best if you are explicit about what needs to match, and what shouldn’t match, and have multiple examples of both in your example dataset. Often, what shouldn’t match helps define the regular expression as much or more than what should match.