Move my PHPBB2 forum to other server

I have a forum named www.sametopic.com/forums/ based on PHPBB 2. I have made many changes and improvement on the original PHPBB 2.0.20 code and added many MOD.

Now I would build another forum , and I don’t want to modify a lot of things on PHPBB 2 code, so I want to duplicate my SameTopic.com forum to the new one, and I want to create the new forum just in the same Godaddy hosting accout as my SameTopic.com forum.

Fortunately, Godaddy provide up to 25 Mysql databases to the customers then I got to create a new database easily. the next, what I should do is ‘Copy’ the old datas to the new database and copy all php files from sametopic folder to the new folder for the new forum.

Please read my detail steps, my new forum works well at present:

1: login to OLD mysql database by your OLD database login info in phpMyAdmin 2.7.0-pl2

provided by godaddy

2: Click ‘Databases’ on the right frame (Don’t select ‘Export’ directly), select database

name such as ‘dbsametopic’;

3: Click ‘Check All’ to select all tables;

4: Click ‘Export’ on the top ;

5: You will now get a screen with quite a few options. Select the options listed below for

the least amount of incompatibility:

Structure
Add DROP TABLEAdd
AUTO_INCREMENT value

Data
Complete insertsExtended inserts
Export Type: INSERT
Save as file (with newer versions you can also choose a name, whatever you like).

Then create a SQL file on your computer as your specified folder;

6: Create a NEW mysql database on your Godaddy account;

7: Login to the NEW mysql database management (phpMyAdmin 2.7.0-pl2 ) ;

8: Click ‘SQL’ on the top in the right frame;

9: Open the previously mentioned SQL file by some text editor tool such as Notes or EmEditor

(if file is big);

10: Copy all the SQL scripts and paste to SQL query text area and click ‘Go’ button;

(If your SQL is small and not over the limited size, you can import it directly as the

following:

8: Click ‘SQL’ icon on the left frame, you will see a popup window;

9: Select ‘Import files’ if your SQL file is not over the size on the right of ‘Browse’

button )

10: Since I just duplicate OLD database to a NEW database that exist in the same godaddy

account, and these two databases are PHPBB, and I just create two seperate sub folder for

OLD and NEW applications,so, for my case, I just modify ‘script_path’ to my new sub folder

in phpbb_config table of NEW database;
OR, if you have set others parameters such cookie_path, you can follow the fowllowing steps:

Your database is now imported successfully. But, we’re not done with phpMyAdmin after that.

We still have to edit some things. Normally, after the import, you will come back to the

same window (SQL). There, put the following SQL queries in the textarea:

UPDATE phpbb_config SET config_value = ‘domain_name_here’ WHERE config_name =

‘cookie_domain’;
UPDATE phpbb_config SET config_value = ‘domain_name_here’ WHERE config_name = ‘server_name’;
UPDATE phpbb_config SET config_value = ‘path_to_phpBB’ WHERE config_name = ‘cookie_path’;
UPDATE phpbb_config SET config_value = ‘domain_name_here’ WHERE config_name = ‘script_path’;
Notes:

Just replace the blue text with the appropriate values. Watch out with the cookie domain and

server name. You cannot include http:// or it will not work.

If you have a different table prefix (the standard is ‘phpbb_’), you may have to change that

in the commands above.

If you have verified that all info is filled in correctly, hit the “Go” button again. It

will update a few configuration settings.

11: Database part done, now you just copy files of the OLD sub foler’s to the NEW folder,

but, You have to change config.php file to your correct configration for NEW application, in

godaddy, different databases located different server, my sample is:

<?php

// phpBB 2.x auto-generated config file
// Do not change anything in this file!

$dbms = ‘mysql4’;

$dbhost = ‘mysqlXXX.secureserver.net’;
$dbname = ‘myNewdbName’;
$dbuser = ‘myNewdbUser’;
$dbpasswd = ‘…..(MyPassword)’;

$table_prefix = ‘(new table prefix)_’;

define(‘PHPBB_INSTALLED’, true);

?>

12: Now you can try to visit your new subfolder and see everything works, but only some data

s got strange show (very few, this because the bug of phpMyAdmin 2.7.0-pl2 and my forum is

UTF-8 encode,don’t matter I don’t care)

—————————
support content provided by other people:

That was it for phpMyAdmin. You can now consider your database ready to go. All you need to

do now, is upload your phpBB files to the new server. So, just download them to your

computer. When done, before uploading, you will have to do one little thing. Edit

config.php.
This file contains information to connect to the database and since you’re moving to another

server, you probably have new connection information.
Open the file in a plain text editor and change the values $dbhost, $dbname, $dbuser,

$dbpasswd to the appropriate ones.

Now just upload everything to your new server. If you have installed hacks like File

Attachments, Photo Albums and so forth you may have to check some file permissions. Refer to

their installation guides if you are not sure what I’m talking about (look for ‘chmod’). If

you allow avatar uploads, be sure to chmod the images/avatars directory to 777 as well. Read

the tutorials on CHMODing if you need to freshen your memory:

CHMOD File Permissions by Rapid Dr3am
CHMOD 2: Number CHMODing by Jaeboy
Windows Server File Permissions by Rapid Dr3am

Well, I guess that is that. Try accessing your forum on the new server. It should work.

Congratulations!

About password changing in ASP.NET 2.0

Changing the Password Complexity in ASP.NET V2.0

(from: http://www.wwwcoder.com/main/parentid/258/site/5221/68/default.aspx)

One of the first things many people try with ASP.NET V2.0 (currently in Beta 2) and with the starter kits is to create a new user. Creating a new user will be common in ASP.NET version 2.0, whether it is the CreateUserWizard, a starter kit form or using the Membership namespace from code.

Scott Forsyth
One of the first things many people try with ASP.NET V2.0 (currently in Beta 2) and with the starter kits is to create a new user. Creating a new user will be common in ASP.NET version 2.0, whether it is the CreateUserWizard, a starter kit form or using the Membership namespace from code. Immediately following that is often a sigh of frustration when a fairly non-descriptive error occurs: “Please enter a different password.” What is that supposed to mean? Is it recommending passwords for us now and not pleased with the one we chose? Did the passwords not match? Even carefully double checking and trying again with a password that is 7 characters and has numbers and upper case and lower case letters triggers this non-descriptive error.

The issue is simply this: ASP.NET V2.0, at the time of writing, has a password complexity requirement of 7 characters and at last 1 non-alphanumeric character. For example, ‘Complex592PaSsWoRd’ isn’t complex enough. A space or a special character is required. Now, being cautious about security is one thing, but many of the V2.0 sites out there now are either test sites, personal or club starter kits or something fairly light. Personally I like to loosen the requirements somewhat, or even loosen them a lot and allow the user to determine how complex they want their password.

Fortunately there are a couple solutions and neither are too complex. The first solution obviously is to enter a more complex password. The second is to override the default complexity requirement and put in your own.

The provider that controls this is the membership provider. This is set by default in the machine.config file on the server. It can be changed at the machine.config file or overridden in the web.config file at the site level.

The two properties that control this are minRequiredPasswordLength and minRequiredNonalphanumericCharacters. They aren’t in machine.config by default in the Beta 2 timeframe. I’m not sure if there are plans to change this or not. To override it, simply add them to the <add name=”AspNetSqlMembershipProvider” /> section. The minRequiredPasswordLength property must be at least 1, while the minReqiredNonalphanumericCharacters property can be 0. Here is an example of the two lines to add which removes the requirements completely and allows the user to decide on their password. Don’t hold me accountable if you open this too much, but I give this example as the other extreme of the default settings.
minRequiredPasswordLength=”1″
minRequiredNonalphanumericCharacters=”0″

Now, let’s say we want to do this at the web.config level. This is easy enough too. The gotcha is that because it already exists at the machine.config level, there will be a clash between the two. So, you must first “remove” the provider that is defined at the machine level and add the adjusted one back at the site level. This can all be done from your web.config file. To remove the existing one, (I’m assuming default names) you use
<remove name=”AspNetSqlMembershipProvider” />

Here is an example of a complete web.config file that could be used. If you have an existing web.config file that you want to work this into, take the section between and including <membership> and </membership> and place it in your <system.web> section.

<?xml version=”1.0″?>
<configuration xmlns=”http://schemas.microsoft.com/.NetConfiguration/v2.0″>
<connectionStrings>
<remove name=”LocalSqlServer”/>
<add name=”LocalSqlServer” connectionString=”Data Source=.\SQLExpress;Integrated
Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf” />
</connectionStrings>
<system.web>
<membership>
<providers>
<remove name=”AspNetSqlMembershipProvider” />
<add name=”AspNetSqlMembershipProvider”
type=”System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”
connectionStringName=”LocalSqlServer”
enablePasswordRetrieval=”false”
enablePasswordReset=”true”
requiresQuestionAndAnswer=”true”
applicationName=”/”
requiresUniqueEmail=”false”
minRequiredPasswordLength=”1″
minRequiredNonalphanumericCharacters=”0″
passwordFormat=”Hashed”
maxInvalidPasswordAttempts=”5″
passwordAttemptWindow=”10″
passwordStrengthRegularExpression=”” />
</providers>
</membership>
</system.web>
</configuration>

Of course anything in my example can be adjusted however you want as long as it is within an allowed range. Take note especially of the connectionStringName which is referenced in the ConnectionString section of web.config and/or machine. config. If you changed your connection string name, then make sure to update the reference to that connection string there. Another thing to take note of is the connection string in this example. That connection string will only work if Sql Server Express is installed on the server and “user instancing” is enabled. At ORCS Web for example, we disable user instancing (because of security considerations), create a database for clients when first setting up sites, and then we provide an alternative connection string which should be used instead.

That’s it. Once you set this, you’ll be able to have a password that isn’t quite so complex. This quick example only briefly covers other considerations like the connectionStringName, user instancing, type of database used and additional properties but I hope it gives enough information to lay the foundation of managing the password complexity within ASP.NET v2.0.

Scott Forsyth is the Director of IT with ORCS Web, Inc. – a company that provides managed hosting services for clients who develop and deploy their applications on Microsoft Windows platforms.

How to insert an image into a content item in Joomla

Important notice!
You need to upload the images before you insert them in content.

Joomla only allows inserting images from the /images/stories folder and one-level subfolders (e.g images/stories/yourfolder)!

If you create subfolders in images/stories, remember to copy the /images/stories/index.html into those subfolders. This prevents unwanted directory listing (and bulk image downloading) is someone tries to directly access your uploaded images.

Important notice!
You need to upload the images before you insert them in content.

Joomla only allows inserting images from the /images/stories folder and one-level subfolders (e.g images/stories/yourfolder)!

If you create subfolders in images/stories, remember to copy the /images/stories/index.html into those subfolders. This prevents unwanted directory listing (and bulk image downloading) is someone tries to directly access your uploaded images.

(it is possible, but not recommended to insert images through HTML tags)

You may upload the images using Joomla’s Media manager, The Joomla XPlorer component, or a ftp client. The important thing is to place images in images/stories. Note that your images/stories MUST be set to world-writable permissions (777).

{mosimage}

Once you’re done with uploading go to the next step.

Login to your Joomla administration, and open a content item for editing. You’ll notice the “images” tab on the right. Click this tab and select the images you want to display in content.(see picture for details). Note that you must click “Apply” after setting image parameters(such as border or caption).

{mosimage}

Inserting images in content items it’s fairly simple. Joomla uses the “mosimage” text enclosed in curly braces as a placeholder for images. So, when you write an article, just insert the {_mosimage_} code(without the underlines) in the place you want an image to appear. Save your content item, and check it out in frontend.

(I wrote the underlines so that Joomla does not interpret my tip as an mosimage code(tag))

You may write this code in article introtext of fulltext.

When displaying content in frontend, Joomla automatically replacest those mosimage codes with the actual images. First code gets replaced by first image, the second mosimage code occurence gets replaced with the second image, and so on. This very article is a living example.

Deleting a content item does NOT delete  any images it may contain.

Why does image publishing work like this?

As you may know, joomla features extensions called “mambots”, which alter content items just before display. This is done automatically, you only need to enable the mambot in administration backend.

The default mosimage mambot simply replaces {_mosimage_} codes with HTML code which in order to display your images in frontend. Note that the mambot does not modify your content items, it modifies on-the-fly the way content displays on your site, each time an article is viewed.

When editing a content item, you see the mosimage code, but when viewing it in the frontend, you get the image. Images names are stored in the “images” field of the mos_content database table.

Using mosimage codes for placing images in content makes easy controlling image display sitewide. An advanced image mambot such as MosThumb can automatically generate thumbnails from images, and link them to a popup window.

(From: http://www.teachmejoomla.com/joomla/mambo-tutorials-and-howtos/general-questions/how-to-insert-an-image-into-a-content-item.html  )

Changing all table names of ASP.NET 2.0 PW Stater kit and moving it to Godaddy.com (3)

Due to the statment before, my multiple asp.net projects work.

However, I have to record another quesition: After I transfer my local asp.net projects on the sub folder of godday account, I found there was no Adminitrator Account in my project! This because I could not upload my user data since asp.net 2.0 use divided database for users account. Then I have searched a way to resolve it:

What I should do are:

1. on my godaddy personal website and create an account named ‘admin’ and its password. (make sure the usernames and passwords are the same as on my local machine!!!)

2: Log back into godaddy Query Analyzer
3: Copy the following T-SQL statement into the Query Analyser window:

SELECT RoleId FROM aspnet_Roles WHERE RoleName = ‘Administrators’
SELECT UserId FROM aspnet_Users WHERE UserName=’username’ (here my username is admin)

Click Submit and get Role ID and User ID , save the return value for use in step

4: Copy the following T-SQL statement into the Query Analyser window:

INSERT INTO aspnet_UsersInRoles (RoleId, UserId) VALUES (‘<roleID>’, ‘<userID>’)

EXAMPLE: INSERT INTO aspnet_UsersInRoles (RoleId, UserId) VALUES (‘{7321ED9B-64FB-47C2-B139-2AF810678D59}’, ‘{E421C366-2905-40FC-8543-0AA618FEE17E}’)

Replace <roleID> and <userID> with the return value from step 3. Retain the single quotation marks around these values. Click Submit.

5: Copy the following T-SQL statement into the Query Analyser window:

UPDATE aspnet_Membership SET IsApproved = 1 WHERE UserId = ‘<userID>’ (this step active admin account)

Done.

The following is other people’s walkthrough for PWS installing on godaddy.com

GoDaddy Installation Walkthrough for Personal website starter kit

from www.asp.net

1. Create your site locally. Include AT LEAST 1 local admin account.
2. Run site using CTRL-F5.
3. Log into your GoDaddy hosting account and open the control panel.
4. Click on ASP.Net runtime and select 2.0
5. Click Databases > SQL Server > Create New Database.
6. Select
1. Check DSN (optional?)
2. Enter UserName (this will become the database name NOT your hosting login)
3. Enter Password (again, database password NOT hosting password)
4. Check “Install Schema Features”
7. Click Continue > Create Database (it WILL take some time for the database to create itself, you can refresh by clicking the SQL button in the left menu)
8. Once setup finishes, Click Pencil icon under actions > print this page.
9. Click Computer icon under actions > record the SQL Connection (.NET) strings
10. Click Open Manager
11. Click Connection > Enter the Username and Password from 6 above.
12. Once connected, expand Tools menu > Click Query Analyzer
13. Cut & Paste all text from club-add.sql into the Query Analyzer window

14. Click Submit (you should see many “command(s) completed successfully” below)

15. Go back to VWD and edit default.aspx
16. Go to Edit > Find & Replace > Quick Replace
1. Find dbo. (NOT Dbo. big difference)
2. Replace with <blank> (nothing, nada, zip, zero)
3. Look in: Current Document
17. Click Replace All (should be 12 or more) > Save default.aspx
18. Repeat steps 16 & 17 for:
1. Events_Edit.aspx
2. Events_View.aspx
19. Open web.config
1. Replace original text
1.

<add name=”ClubSiteDB” connectionString=”Data Source=.\SQLExpress;

Integrated Security=true;

AttachDBFileName=|DataDirectory|Club.mdf;

User Instance=True” providerName=”System.Data.SqlClient”/>
2.

With new text
1.

<add name=”ClubSiteDB” providerName=”System.Data.SqlClient”

connectionString=”server=whsql-v04.prod.mesa1.secureserver.net;

database=DB_12345;

uid=myusername;

pwd=mypassword”/>

<remove name=”LocalSqlServer”/>

<add name=”LocalSqlServer” providerName=”System.Data.SqlClient”

connectionString=”server=whsql-v04.prod.mesa1.secureserver.net;

database=DB_12345;

uid=myusername;

pwd=mypassword”/>
20.

Change <customErrors mode=”Off” /> (optional)
21.

Save!!!
22.

Run CTRL-F5 again. (it will bring up a window with a server error, what you want is to look in the lower left corner of the VWD window for “Build Successful”)
23.

Click Website > Copy Web Site > Connect
24.

Input your hosting username and password (NOT you database uid and pwd)
25.

Highlight all files from the left side and click right arrow to transfer.
26.

* Go to your public website and create an account for each admin you created on your local database. (make sure the usernames and passwords are the same!!!)
27.

Log back into Query Analyzer
28. To Grant Administrator Privileges to an ASP.NET 2.0 User Account

1. Log in to your Account Manager.
2. Under the Hosting & Email section, select Hosting Account List.
3. Next to the hosting account you want to modify, click Open.
4. Under the Databases section of the Hosting Manager, click the SQL Server icon.
5. Next to the name of your SQL Server database, click Open Manager. The SQL Server Web Admin tool displays.
6. In the tree on the left, expand the Connection folder and select Connection.
7. Enter the User Name and Password for your database. You created your user name and password when you set up your SQL server database.
8. Expand the Tools folder on the left and select Query Analyser.
9. Copy the following T-SQL statement into the Query Analyser window:

SELECT RoleId FROM aspnet_Roles WHERE RoleName = ‘Administrators’

Click Submit and save the return value for use in step 11. Click Reset.
10. Copy the following T-SQL statement into the Query Analyser window:

SELECT UserId FROM aspnet_Users WHERE UserName=’username’

Replace <username> with the user name of the account to which administrator privileges will be granted. Retain the single quotation marks around this case-sensitive value. Click Submit and save the return value for use in step 11. Click Reset.
11. Copy the following T-SQL statement into the Query Analyser window:

INSERT INTO aspnet_UsersInRoles (RoleId, UserId) VALUES (‘<roleID>’, ‘<userID>’)
EXAMPLE: INSERT INTO aspnet_UsersInRoles (RoleId, UserId) VALUES (‘7321ED9B-64FB-47C2-B139-2AF810678D59’, ‘E421C366-2905-40FC-8543-0AA618FEE17E’)

Replace <roleID> with the return value from step 9. Replace <userID> with the return value from step 10. Retain the single quotation marks around these values. Click Submit.

Thanks again to BoosterMan, and all those who made this walkthrough possible. Great Job and keep up the good work

Chaning all table names of ASP.NET 2.0 PW Stater kit and moving it to Godaddy.com (2)

I would like to put my own PWS into the sub folder on godaddy.com and I hope I can build multiple ASP.NET projects on the same godaddy ASP.NET account.

I even tried to create sub folders throught FTP tools on my godaddy hosting space, but after I finished to transfer my local files on that sub folder, I found it could not work. I thought it was not a simple operation like what I did. Then I posted my question on www.asp.net forums, a friend answered for ASP.NET project running in a sub folder, I have to ask goddaddy.com to provide me the relevant service.

Later I wrote an Email to support@godaddy.com, repidly I got their reply like the following:

Dear Sir/Madam,

Thank you for contacting Online Support.

You may specify permissions for your ASP hosting account with the following directions. Please note that the ‘Directory Management’ button will not be available if you have FrontPage extensions installed.

You can uninstall FrontPage Extensions from the ‘Other Settings’ page or modify your permissions through your website publishing software.

First, log into your customer account:

. Go to the Go Daddy Account Login Page.
. Log in using your account username (which may be the same as your customer number) and password.

If you have trouble logging in, our password reset form may help you. You can find this form through the following link:
Account Retrieval Page

Once logged in, follow these steps:

. Select ‘Web Hosting & Databases’ from the ‘Hosting & Email’ menu at the top of the page
. Click the ‘Open’ link under the Control panel heading for the hosting account you wish to manage
. Under ‘Content’ click on ‘Directory Management’
. Click the ‘Create Directory’ button
. Enter the ‘Directory / Subdirectory’ name
. Specify the permissions by checking the box under the appropriate column. (Read, Web, Browse, Write, Reset)
. Click the ‘Continue’ button
. Click ‘Add’ to confirm the update

You also have the option to remove existing folders from the list by using the reset option; this sets the folder to the correct permissions, and then removes the folder from the list.

Please let us know if we can help you in any other way.

Then I know I can get the implishment of my tasks. I created my customer directory and set on the permision to Read, Write, Web, Root Set (Application Root), I have waited for a while, about 10 minites, I saw the folder was created (I used FTP tool to watch).

Later I transfer my local asp.net website published files to this customer directory and modified web.config by giving correct connection string.

However, I still got error message when I tried to visit my PWS:

This application was precompiled with personalization turned off, but it appears to have been turned on after the precompilation, which is not supported.

I asked goddaddy.com again but they told me they don’t troubleshoot or fix custom coding. So I have to resolve it by myself.

I noticed that I have build another asp.net project on the original root folder, then I created another customer directory and move the old files from the original root folder to the new customer folder, haha! I found It works, I can visit this project by click www.mydomain.com/mycustomerdirectory2/ ! And, I found the previous project I mentioned above works too by click www.mydomain.com/mycustomerdirectory1/ ! This is great!

So the reason maybe came from I put another asp.net project to the original root folder, then, for building multiple ASP.NET 2.0 projects, I should put them to different sub folders and don’t put the original root folder? I am not sure, but I don’t care, I just want to builder multiple asp.net projects on different sub folders, this is just what I want !

the following is my connctiStrings content in my web.config file:

<connectionStrings>

<add name=”Personal” connectionString=”server=whsql-v0XXX.prod.mesaXXXX.secureserver.net;
database=DB_XXXX;
uid=XXXX;
pwd=XXXXXXXXXXX;
Trusted_Connection=False” providerName=”System.Data.SqlClient” />

<remove name=”LocalSqlServer”/>

<add name=”LocalSqlServer” connectionString=”server=whsql-v0XXX.prod.mesaXXXX.secureserver.net;
database=DB_XXXX;
uid=XXXX;
pwd=XXXXXXXXXXX;
Trusted_Connection=False” providerName=”System.Data.SqlClient” />

</connectionStrings>

(attention: XXX is hidden content)

Chaning all table names of ASP.NET 2.0 PW Stater kit and moving it to Godaddy.com (1)

Intro:

I created a personal website based on MS ASP.NET 2.0 personal website starter kit on my local PC. It runs well. Once time I moved it to a free asp.net hosting provided the same environment like MS Visual studio 2005 development such as SQL Server 2005 Express. So It was very easy to migrate from local. For the database, I just copied the two .mdf files (aspnet.mdf and personal.mdf) to that hosting server and click “attach” buttons that they provided. then I got all data as same as my local’s; and then uploaded all relevant files , then, done for everything.

However, The free is not always convenient for you. some days I have not managed my site, it gone! I lost all my personal website content!
So, I bought a asp.net space from Godaddy.com and tried to move my local personal website based on starter kit to my godaddy.com space.

The following is my migrating process:

1.install MS Sqlserver management studio express;

download: http://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796&DisplayLang=en

2. Detach ASPNETDB.mdf and Personal.mdf on your local PC if you are using MS visual studio 2005 to open them;

3. Run Sqlserver management studio express. connnect to the sqlserver that you have intalled in ur pc.

4. in the “Object Exploer” windows, right click “Databases”, select “Attach…”, then open your database .MDF file (sql server 2005 express file);

5: right click the database file that u just now attached. select “Tasks” > “generate Scripts”. then generate sql file you want (create or drop);

Note1: I changed the “Script for Server version” to “Sql server 2000” on “Choose Script options” page since godaddy.com just provides sqlserver 2000 but not 2005)
Note2: I selected tables and store processes, create SQl to a file
NOTE3: sqlserver management studio express can not generate data for you ,just generate empty table stucture!! so I have to add data manually! but you can use the 3rd part script to backup and insert your part of data (see following content), then if I have lots of data, the sqlserver management studio express is no useful!

(Sure you can get your data if you use backup and restore option. But for me, the tables name changed, so I can not use backup and restore ways )

5: u can use these sql file to build your database on remote hosting for ur asp.net project. attention the sqlserver version on the remote hosting, u can select sql server version when u generate script file;

6: u can change the tables name through these sql file. just change the tables name manually in .sql file, then run sql script file on remote hosting;(right click database name and select “new query”, then copy the content of sql file and then excute)

7: detach the database file from sql server management express;

8: open visual studio 2005, u need to change the asp.net code for the changing of table and store precedures’ name

9: sqlserver management express can not generate sql file for data, just backup, so if you changed the table name , u have to copy data from original tables to new tables one by one manual; OR,

you can use this script , it is a very good script:
http://vyaskn.tripod.com/code.htm#inserts
How ever, it can not copy image field, so for image fields, I had to download from old project and then upload to new project one by one manually.

more notes about use the above script:

1: after download the script, copy to notepad, should turn off notepad’s word wrap;
2: copy the script to SQL Server Management Express’ SQL Query window;
3: open a new SQL query windows and copy the following codes, this is to  generate INSERT statements for all the tables in your database, execute the following query in that database, which will output the commands, that you need to execute for the same:

SELECT ‘EXEC sp_generate_inserts ‘ +
‘[‘ + name + ‘]’ +
‘,@owner = ‘ +
‘[‘ + RTRIM(USER_NAME(uid)) + ‘],’ +
‘@ommit_images = 1, @disable_constraints = 1’
FROM sysobjects
WHERE type = ‘U’ AND
OBJECTPROPERTY(id,’ismsshipped’) = 0

4: excute the above script and I will get the result like the following in the result window of SQL Server Management Express:

EXEC sp_generate_inserts [sysdiagrams],@owner = [dbo],@ommit_images = 1, @disable_constraints = 1
EXEC sp_generate_inserts [PWS_SiteContent],@owner = [dbo],@ommit_images = 1, @disable_constraints = 1
EXEC sp_generate_inserts [PWS_Albums_Special],@owner = [dbo],@ommit_images = 1, @disable_constraints = 1
EXEC sp_generate_inserts [PWS_Photos_Special],@owner = [dbo],@ommit_images = 1, @disable_constraints = 1
EXEC sp_generate_inserts [PWS_Projects],@owner = [dbo],@ommit_images = 1, @disable_constraints = 1
EXEC sp_generate_inserts [PWS_Albums4FileSys],@owner = [dbo],@ommit_images = 1, @disable_constraints = 1
EXEC sp_generate_inserts [PWS_Photos4FileSys],@owner = [dbo],@ommit_images = 1, @disable_constraints = 1
EXEC sp_generate_inserts [PWS_Albums],@owner = [dbo],@ommit_images = 1, @disable_constraints = 1
EXEC sp_generate_inserts [PWS_Photos],@owner = [dbo],@ommit_images = 1, @disable_constraints = 1

5: copy the above script and paste into a new SQL Query script window and excute them;

I would get the insert script of my personal site database (no include ASPNETDB database) for data insertions

6: Copy the final script and paste into SQL Query window of Godaddy account….

when I tried to submit and execute them , I got errors because the following reason, then I deleted those script cause these errors , just let good scripts run firtly.

Those fields are about images, I have to   insert image by manual when my website run, Don’t try to insert default or others values like the following way , just let the PWS_Photos and PWS_Photos_Special tables empty firtly, later when website run I insert images one by one manually :

I have to modified the above data insert script manually because in my database there are some images fields are not nullable, but the above script do not include this un_nullable fields such as thoes images field in photos tables,

I added default values (”) for those images fields (ie: largeimage), for example:

INSERT [dbo].[PWS_Photos_Special] ([id],[title],[albumid],[notes],[largeimage])VALUES(1,’Indigo Projects Management’,1,NULL,”)
INSERT [dbo].[PWS_Photos_Special] ([id],[title],[albumid],[notes],[largeimage])VALUES(2,’ALE’,1,NULL,”)
INSERT [dbo].[PWS_Photos_Special] ([id],[title],[albumid],[notes],[largeimage])VALUES(3,’GMLC’,1,NULL,”)
INSERT [dbo].[PWS_Photos_Special] ([id],[title],[albumid],[notes],[largeimage])VALUES(4,’I3DVR’,1,NULL,”)
INSERT [dbo].[PWS_Photos_Special] ([id],[title],[albumid],[notes],[largeimage])VALUES(5,’GSM’,1,NULL,”)
INSERT [dbo].[PWS_Photos_Special] ([id],[title],[albumid],[notes],[largeimage])VALUES(6,’NetEase’,1,NULL,”)
INSERT [dbo].[PWS_Photos_Special] ([id],[title],[albumid],[notes],[largeimage])VALUES(7,’Railway Military’,1,NULL,”)
INSERT [dbo].[PWS_Photos_Special] ([id],[title],[albumid],[notes],[largeimage])VALUES(8,’SCP’,1,NULL,”)

Here is another good article for how to move sqlserver database to remote hosting:
http://blogs.msdn.com/robburke/archive/2006/05/30/610803.aspx

(用sqlserver management express时,可以同时attach旧的和新的mdf文件,但是旧的在attach时要修改一下attach as到新的路径,即和新的mdf文件不要一样的路径就行了。)

for the tables’ prefix string changing, just add my prefix string for all tables one by one, and change my asp.net codes in files.

login to godaddy.com and access to your asp.net database, open it , use Qurery Analyst tool, copy all your .sql content and paste into Qurery Analyst, run it.。

But I got an error:

CREATE TABLE [dbo].[PWS_SiteContent](
[TextID] [int] NOT NULL,
[Homepage_Welcome] [varchar](max) NULL,
[Homepage_WhatsNew] [varchar](max) NULL,
[Homepage_WhatsUpLately] [varchar](max) NULL,
CONSTRAINT [PK_PWS_SiteContent] PRIMARY KEY CLUSTERED

Line 11: Incorrect syntax near ‘max’.

later I will write how I resovle this problem.

Finally I found SQL Server doesn’t support (max), I changed (max) to (4000), then works!