ℹ️
Welcome to the archive of the old FlatPress support forum. Browse more than a decade of FlatPress wisdom! Login is disabled.

The current FlatPress support forum is available here: forum.flatpress.org
From Wordpress to Flatpress?
  • Hi, i have a self hosted Wordpress blog and i want to migrate to Flatpress. The idea is move the blog from my personal pc (runing Ubuntu LAMP) to a raspberry pi (runing Debian wheezy). The raspberry pi is ready, lighttpd, php and everything is ok. Flatpress is also installed and working amazingly fast (and i'm so happy for that) . Now i just need to migrate my old wordpress to the new flatpress. My first move was to search this forum. I did the suggested step in this thread http://flatpress.org/vanilla2/discussion/comment/8224#Comment_8224 but all i can see when i run convert.php is nothing but blank. Debug parameter is changed as suggested. What i have to expect? Do i have to search for files or something? Please, can you help me? I have no clue where to go or where to look for from here.
    Thanks in advance :)

    :)
  • that is quite strange, you should see at least some error. is the flatpress instance you are using for importing installed on the same server where wordpress resides?
  • Yes. My first move was to move Wordpress from my personal pc to the raspberry pi, that was easy. And for now it's working (slow, but working). The second step was to install flatpress (and i thank you for making the install extremely easy). After this point, i execute http://mylocaladress/flatpress/convert.php and i see this repetitive warning in syslog:
    PHP Warning:  mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /var/www/neil/flatpress/convert.php on line 44

    I also checked lighttpd's error log and i see another warning which i think it has nothing to do with the main issue, but maybe also interesting.

    PHP Warning:  mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/neil/flatpress/fp-includes/core/core.date.php on line 95

    FYI I'm runing Debian wheezy with:
    PHP Version 5.4.4.-2
    Mysql server  5.5
    Lighttpd 1.4.31

    Thanks for taking time to help me :)
  • Hi, I can help you for the second error, not sure for the first.

    To fix the second error you have to modify a file in /etc/php5/conf.d/ (for example I created the file /etc/php5/conf.d/10-time.ini) and put this content:
    date.timezone = Your area
    You can see the list of all areas in this page.

    For the second error: is the TCP socket of MySQL enabled?
    Are you trying to connect to the database of the server or to the databse of you desktop?
    In the second case I think that Ubuntu's policies are the same of Debian: allow TCP connections to MySQL only to localhost (and maybe the loopback interface).

    The Raspberry Pi is nice, I've heard about it, however I suggest you to switch from Lighttpd to Nginx that is even lighter.
  • Hi pierovdfn,
    Thanks for your answer. I've switched the scenario to Nginx+varnish+mysql+wordpress+w3 total cache, it works faster than the old scenario (lighttpd+mysql+wordpress) but it's not fast enough. So i'll stick with my first idea, move to Flatpress. 
    I'm no expert (just user, no admin) and i'm not sure about that mysql question, if i do a "netstat -putan | grep LISTEN" i can see Mysql listening on port 3306. If i look at my.cnf i can see... well, it's better if i post the entire config file :P
    Here you are: 
    My.cnf

    [client]
    port = 3306
    socket = /var/run/mysqld/mysqld.sock

    # The MySQL server
    [mysqld]
    port = 3306 
    socket = /var/run/mysqld/mysqld.sock 
    skip-external-locking
    key_buffer_size = 16K
    max_allowed_packet = 1M 
    table_open_cache = 4 
    sort_buffer_size = 64K 
    read_buffer_size = 256K 
    read_rnd_buffer_size = 256K 
    net_buffer_length = 2K 
    thread_stack = 64K 
    bind-address            = 127.0.0.1
    innodb=OFF
    default-storage-engine=MyISAM

    #skip-networking
    server-id = 1

    #log-bin=mysql-bin

    #binlog_format=mixed

    #binlog_direct_non_transactional_updates=TRUE

    #innodb_data_home_dir = /var/lib/mysql
    #innodb_data_file_path = ibdata1:10M:autoextend
    #innodb_log_group_home_dir = /var/lib/mysql
    #innodb_buffer_pool_size = 16M
    #innodb_additional_mem_pool_size = 2M
    #innodb_log_file_size = 5M
    #innodb_log_buffer_size = 8M
    #innodb_flush_log_at_trx_commit = 1
    #innodb_lock_wait_timeout = 50

    [mysqldump]
    quick
    max_allowed_packet = 16M

    [mysql]
    no-auto-rehash
    #safe-updates

    [isamchk]
    key_buffer = 1M
    sort_buffer_size = 1M
    [myisamchk]
    key_buffer_size = 1M
    sort_buffer_size = 1M

    [mysqlhotcopy]
    interactive-timeout

    Forget about my Desktop PC, all this thing is done at the Raspberry Pi. 
    Thanks for your time :)
  • can you try this version? http://pastebin.com/7rsKF3WC

    it seems that mysql_query() will return a boolean instead of a resource under certain circumstances

    http://it.php.net/manual/en/function.mysql-query.php#108892

    the guy here says "because windows is case insensitive". Of course this makes no f*cking sense, since we are talking about a database, not a filesystem, but whatever. I stopped trying to find an answer to every oddity PHP has made me accustomed to. I just swear and then try to fix it by trial and error :P
  • Well, maybe MySQL checkes the file name (or did it in the past), however I think that cases should be respected in any case.

    The my.cnf is right, otherwise you had the error on the connection. I've read the error quickly and I tought PHP was complaining about the resource of the MySQL connection, but it's actually the resouce of the query.

    I've just a little doubt: the exporter was made for Wordpress 2.x, wasn't it?
    Maybe things are changed in WP 3.x, possible?

    For the configuration, I think that with FP you won't need varnish, however it's a good idea keeping Nginx, because if is lighter so the CPU works less and stays cooler.
  • Well, maybe MySQL checkes the file name (or did it in the past), however I think that cases should be respected in any case.


    well, no, since SQL is a case insensitive language; if MySQL is making a distinction, then MySQL is wrong. However, I still can't understand why PHP should return a boolean without throwing an error in that case. 

    EDIT OH GOD HERE'S WHY because of this usage pattern:
    mysql_query('…') or die(mysql_error());

    GIANTFACEPALM.JPG

    I don't remember which version of WP was targeted, though, but I think wp3 was already out at the time. 

    btw
  • Thank you for all your effort, so,now.. what i have to do? Do i need to edit something? I'm totally lost :P


  • try the version I've linked a few posts above
  • Hi NoWhereMan, Pastebin.com says "unknown paste id", is it already expired?
    :)
  • ok, I've edited the original here http://wiki.flatpress.org/tools:db:wpimport to print an error in case of failure. At least we'll be able to read what's going on
  • Hi! At last! The script wants to retrieve the wp_categories table but wp_categories is no longer a table! Can you please (please please please please) fix that? :)
    Thank you!

  • Unfortunately I have no time to support categories with this new db schema, I have just added a flag to ignore them altogether. It is on by default. http://wiki.flatpress.org/tools:db:wpimport

    hth
  • Thank you again,
    There's a missing ?> at the end of the script, can you update the wiki? :)
    When i run convert.php it's still trying to get wp_categories, so i think it's because of this line:
    $cats = mysql_query('SELECT * FROM wp_categories ORDER BY category_parent')
     	 	or die(mysql_error());
    I've commented that line and run convert.php again, now i see a lot of lines like this (one for each post and some more for the comments):
    SAVE: here i come (18 => 1096451778) 
    	COMM SAVE: here i come 2 => 1096458104) 
    So i think it worked, but i log to control panel and there's nothing but the sample post. Do i need to do anything else after runing convert.php?

    Thank you, and sorry if this is giving you a headache :P
  • ok, hit me, i've missed to set DEBUG to FALSE.. Now it worked, my posts are imported to flatpress :)
    Thank you very very much.

  • the ?> is deliberately being omitted. I'll wrap that line you point out in the if statement, so that the query will not be issued anymore.
  • Hope this thread will help others :)

  • Hoping that someone with good php skills will have a converter ready for worpress 3.4.1 to flatpress.. At the moment, the current one could only bring in posts but not categories.
  • Add a Comment
    Start a New Discussion

    Howdy, Stranger!

    It looks like you're new here. If you want to get involved, click one of these buttons!

    Categories

    In this Discussion