php - Moving html data from mysql (wordpress) to sqlserver -


i upgrading website asp.net have @ least 100k posts in wordpress. not find related topic moving wanted share experience.

big data not problem, however, of wordpress tables have html data containing quotes (both single , double), &nbsp's, tab characters , on. have tried many ways both exporting however, exporting sql file not work me (at least, not able work it, causes many troubles).

best way move data exporting csv files, seperately each table. while exporting, have to:

  1. custom export
  2. different , unique strings both "columns separated with" , "columns enclosed with" (i used ############ , @@@@@@@, respectively)
  3. check "remove carriage return/line feed characters within columns"
  4. check "put columns names in first row"
  5. download export file

after downloading, replacing take place:

  1. tabs spaces \t -> space
  2. double quotes single " -> '
  3. ###### -> \t
  4. @@@@@@@ -> "

finally, encoding conversion required. myadmin output ansi file , corrupt. sql server might not able handle it. resolve it, first convert utf-8 , convert ansi again (in notepad++, has options in "encoding" menu).

while importing sql server, must have select text file source. select related csv files , while importing, take care of column lengths. sql server make columns varchar(50) default. exported data have more larger columns. have adjust them in import wizard manually. use dt_text (not dt_ntext) string values.

i know process result in data loss (tabs , double quotes) however, wordpress' html editor's fault. html data should stored encoded in database these purposes...


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -