Index: lib/rb-file-helpers.c
===================================================================
--- lib/rb-file-helpers.c	(revision 6043)
+++ lib/rb-file-helpers.c	(working copy)
@@ -46,6 +46,7 @@
 static GHashTable *files = NULL;
 
 static char *dot_dir = NULL;
+static char *xdg_dot_dir = NULL;
 
 const char *
 rb_file (const char *filename)
@@ -100,6 +101,47 @@
 
 
 const char *
+rb_xdg_dot_dir (void)
+{
+	if (xdg_dot_dir == NULL) {
+		xdg_dot_dir = g_build_filename (g_get_home_dir (),
+						".local",
+						"share",
+						"rhythmbox",
+						NULL);
+		if (g_mkdir_with_parents (xdg_dot_dir, 0750) == -1)
+			rb_debug ("unable to create XDG Rhythmbox's dot dir");
+	}
+	
+	return xdg_dot_dir;
+}
+
+
+void
+rb_dot_to_xdg_dot (const char *filename) {
+	GError *error;
+	GFile *src;
+	GFile *dest;
+	char *srcname;
+	char *destname;
+
+	/* XDG playlists file doesn't exists */
+	srcname = g_build_filename (rb_dot_dir (), filename, NULL);
+	src = g_file_new_for_path(srcname);
+
+	destname = g_build_filename (rb_xdg_dot_dir (), filename, NULL);
+	dest = g_file_new_for_path(destname);
+
+	/* Move the file to the new XDG folder */
+	g_file_move(src, dest, G_FILE_COPY_BACKUP, NULL, NULL, NULL, &error);
+
+	g_free (srcname);
+	g_free (destname);
+	g_object_unref (src);
+	g_object_unref (dest);
+}
+
+const char *
 rb_music_dir (void)
 {
 	const char *dir;
@@ -128,6 +170,7 @@
 {
 	g_hash_table_destroy (files);
 	g_free (dot_dir);
+	g_free (xdg_dot_dir);
 }
 
 #define MAX_LINK_LEVEL 5
Index: lib/rb-file-helpers.h
===================================================================
--- lib/rb-file-helpers.h	(revision 6043)
+++ lib/rb-file-helpers.h	(working copy)
@@ -37,6 +37,8 @@
 
 const char *	rb_file			(const char *filename);
 const char *	rb_dot_dir		(void);
+const char *	rb_xdg_dot_dir		(void);
+void		rb_dot_to_xdg_dot	(const char *filename);
 const char *	rb_music_dir		(void);
 
 char *		rb_canonicalise_uri	(const char *uri);
Index: shell/rb-shell.c
===================================================================
--- shell/rb-shell.c	(revision 6043)
+++ shell/rb-shell.c	(working copy)
@@ -691,6 +691,7 @@
 	shell->priv = RB_SHELL_GET_PRIVATE (shell);
 
 	rb_dot_dir ();
+	rb_xdg_dot_dir();
 
         rb_shell_session_init (shell);
 
@@ -972,10 +973,12 @@
 	char *pathname;
 
 	/* set default playlist name, if none supplied */
-	if (playlists) 
+	if (playlists) {
 		pathname = g_strdup (playlists);
-	else 
-		pathname = g_build_filename (rb_dot_dir (), "playlists.xml", NULL); 
+	} else if (!g_file_query_exists(g_file_new_for_path(g_build_filename (rb_xdg_dot_dir (), "playlists.xml", NULL)), NULL)) {
+		rb_dot_to_xdg_dot("playlists.xml");
+	} 
+	pathname = g_build_filename (rb_xdg_dot_dir (), "playlists.xml", NULL); 
 	
 	s = g_object_new (RB_TYPE_SHELL,
 			  "no-registration", no_registration,
@@ -1007,10 +1010,13 @@
 	rb_debug ("creating database object");
 	rb_profile_start ("creating database object");
 
-	if (shell->priv->rhythmdb_file)
+	if (shell->priv->rhythmdb_file) {
+		rb_debug("Using rhythmdb_file for database");
 		pathname = g_strdup (shell->priv->rhythmdb_file);
-	else
-		pathname = g_build_filename (rb_dot_dir (), "rhythmdb.xml", NULL);
+        } else if (!g_file_query_exists(g_file_new_for_path(g_build_filename (rb_xdg_dot_dir (), "rhythmdb.xml", NULL)), NULL)) {
+		rb_dot_to_xdg_dot("rhythmdb.xml");
+	}
+	pathname = g_build_filename (rb_xdg_dot_dir (), "rhythmdb.xml", NULL);
 
 #ifdef WITH_RHYTHMDB_TREE
 	shell->priv->db = rhythmdb_tree_new (pathname);
