Migration problems (windows to Linux)

Having trouble installing serendipity?
Post Reply
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Migration problems (windows to Linux)

Post by hgoor »

I just installed 1.0 on my Linux box and try to migrate from another PC, but here are some problems.

- Installed 1.0 in root of my box: /var/www (not /var/www/serendipity)
- I Copied all images etc.
- I imported database
- I copied all plugins
- corrected all paths to point to /var/www

Symptoms:

- admin module has no template: looks ugly (FIXED: url rewrites??)
- the website does have seem to have templates: so that seems to work
- all paths to all images in my blogs all point to wrong dir: /var/www/serendipity result: no pictures even though they are in media library
- where the hell are all the archives?
- how come some plugins now appear more than 1 time?

Grr, why does this stuff have to be so complicated (in comparision to XP)?
:evil:
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Migration problems (windows to Linux)

Post by garvinhicking »

Hi!

Can you give us a SQL dump excerpt of this SQL query:

SELECT * FROM serendipity_config WHERE name LIKE '%path%';

This should list all path settings. Maybe you forgot to change one of the HTTP paths from "/serendipity" to "/"?

Sadly image URL paths are stored in the Entry URL, so all images you inserted in the media database will now point to a wrong directory. The best way for you would be to create a symbolic "serendipity" link in your directory that points to "..", so that your webserver will show the old images. The other option would be for you to install s9y into a "serendipity" directory, or to manually edit all entries for the new path. Of course you could also edit the SQL dump file and replace "/serendipity/" with "/".
- how come some plugins now appear more than 1 time?
This can happen if you installed serendipity into an existing database. I already covered this in another of your postings, this was because you wrongly installed a different s9y version on your server :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

I just did the query (also learned how to do this) and this was the output:

serendipityPath /var/www/
uploadPath uploads/
serendipityHTTPPath /
templatePath templates/
uploadHTTPPath uploads/
permalinkArchivesPath archives
permalinkArchivePath archive
permalinkApprovePath approve
permalinkDeletePath delete
permalinkAuthorsPath authors
permalinkUnsubscribePath unsubscribe
permalinkCategoriesPath categories
permalinkFeedsPath feeds
permalinkPluginPath plugin
permalinkAdminPath admin
permalinkSearchPath search
serendipity_event_backup:6086e4f9a68367c78e6fc1f9e...
F:/backups/autobackups

So the only problem can be the backup-plugin, but that should not interfere with the images right?

How do I create a symbolic "serendipity" link that points to ".." ??

As far as those paths used for images: why not use a image-path-variable for that so it's not a problem if you move files around?? That would be much smarter?
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Okay, sine the path settings are right, they seem to come from the entries themselves as I was afraid they would.

The Symbolic link can be created with:

Code: Select all

cd /var/www
ln -s -d /var/www serendipity
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

ok, great, that solved the problem...

yet 1 step closer to a full migration.

Thanks a bunch!

However: maybe an idea for 1.1 to make images linking from the imagelibrary some kind of variable in the code?

In my old blog it has a complete path, which as I find out now, is a problem when migrating.

If this would have been a path that I can actually control I can make sure things go right?
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Yes, 1.1 is a step further there, we now store the image IDs in the entry so that replacement should be easier. :)

However that will only be used in the future once that people begin to use it, and we'll see where to go from there. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

Oh, and thanks for the tip for editing the database dumps: since they are simple textfiles afterall I can use Textpad and just take everything out that doesn't belong there....

Regards,

Henk
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

That does make things almost dirt-simple, doesn't it? I was frightened of database dumps until I realized they were just plain text.
Judebert
---
Website | Wishlist | PayPal
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

Yup. But always make a back-up :-)

Now, if only I get the hang of that Linux permission crap. CHMOD and CHOWN etc. It's just one big pain in the ***.

I found out so far that 99% of my problems with Linux are permission related.

For instance: how can I make sure that ALL files in my /var/www always have 777 for permission and if I upload/copy something as a regular user everything automagically inherits these settings???

It is driving me crazy....

People might say that Linux is ready to take over the desktop, well, I say it never will unless it gets as user-friendly as windows or Mac...
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

I was once a Windows user, like you. I found the Linux permission thing difficult, but a friendly guru told me that my problem was simply the way I had learned.

Linux was built around the command-line. Instead of moving that mouse around, you talk to the computer -- like text-messaging, actually. chmod and chown, like LOL and WTF, are shortened versions of English commands: in this case, CHange MODe and CHange OWNer.

Which brings us to the permission thing. It's not so difficult, really, and not so different from Windows. Each file has an "owner". That's a single user, usually the one who created the file. Each user can belong to multiple "groups". (So far, they're exactly alike.) Permissions are defined as "read", "write", and "execute", in that order, and restrict what you're allowed to do with the file.

Windows keeps a database of permissions, based on users and groups, sorted for each file; you get the most restrictive permissions possible. Linux gives each file a user-owner and group-owner, and a set of permissions to use when the user matches the file's owner or belongs to the file's group. It also defines a set of permissions to use when nothing matches. You get the most permissive permissions possible.

In Windows, you have to use a graphical tool to figure out all the permissions, and sometimes it has to go all through the file's parents, since files don't necessarily have permissions associated with them. In Linux, every file has permissions, and you can check them just by asking for them: use the List Sideways command, ls.

Permissions in Linux are usually displayed like this:

Code: Select all

-rwxrw-r-- user:group filename
The first dash is special; just ignore it. Sometimes it'll be an l or d. The next three characters are Read, Write, and eXecute permissions for the owner. The next three are the same for the group. The next three are for everybody else. If a character is missing, that user doesn't have that permission. In the example above, the owner has read, write and execute permissions; the group has only read and write; the user can only read.

Notice that they always come in the same order, just like I mentioned before. That lets us use numbers, instead of letters, for shorthand. If we decide that R is worth 4, W is worth , and X is worth 1, we can specify any combination with just one number between 0 and 7. For instance, rw- is 6; r-x is 5; and --- is 0. You can translate backwards, too, of course. That makes the example above 764.

The chmod command lets you use either the shorthand number or a more easily remembered text string. To change the permissions mode of any file, just say something like:

Code: Select all

chmod 764 myfile.txt
If you prefer something more English-like, you can say:

Code: Select all

chmod u+rwx g+rw o+r myfile.txt
which will ADD permissions for the User, Group, and Others, or:

Code: Select all

chmod g-x o-wx myfile.txt
which will REMOVE those permissions.

Finally, you asked how to make ALL the files in /var/www have 777 for all users. For that, you need to tell chmod to work Recursively. Like this:

Code: Select all

chmod -R 777 /var/www
Most of the graphical file managers -- like Nautilus for Gnome -- will let you do this, too, just by clicking a few buttons. It's just a matter of learning it. It's not Windows, but it's not rocket science, either. In fact, my 8-year-old daughter uses Linux all the time.

Unfortunately, a user can create files with any permissions he likes. So the only way to make sure that all files in /var/www are 777 all the time is to periodically run that chmod command. There is a command to change the default: User permissions MASK, or umask. Since your webserver is probably the one running Serendipity, you could change its umask to 777. But then all /var/www files could be modified by anyone with access to your webserver. The default permissions are more secure.
Last edited by judebert on Thu Jul 20, 2006 7:50 am, edited 1 time in total.
Judebert
---
Website | Wishlist | PayPal
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

Hey thanks for the expose. I did happen to have a book lying around here about linux (5 years old, but these commands never changed)...

I know that the whole permission thing is actually one of the reasons why linux is so secure in comparisson with XP (you're doing everything with admin rights there)..

But I just dislike it...

Anyway: I have a new problem (see my other post)...

Ps: btw it's -R cause -r doesn't work :-)
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

OMG. Newbie mistake. "-r" means "remove Read privileges", so we need a different letter for "Recursive". I edited the post in case someone else wants to use it as a reference.

Thanks for the heads-up!
Judebert
---
Website | Wishlist | PayPal
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

LOL, I guess it's like 30+ degrees overthere as well :-)
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
Post Reply