Hamid1920
  • Posts: 6
  • Joined: 30/10/2014
Hi
I want to import all data from dnn forum to yaf
first I need to import all user from dnn to yaf
unfortunately there is no menu in Users and roles in admin page for doing this thing
My question is how can I do that?
Sponsor
Zero2Cool
  • Posts: 1082
  • Joined: 26/04/2011
You're wanting to import DotNetNuke Forum to YetAnotherForum, right? I don't know if there is a tool available for that. Are you going to use YAF within DNN, or using YAF standalone?
Hamid1920
  • Posts: 6
  • Joined: 30/10/2014
I use Yaf Within dnn
For first step I need to import all users from dnn to yaf
As I know Yaf has its own user table
before importing my old forum to yaf I need create users in yaf table
tha_watcha
  • Posts: 4083
  • Joined: 06/03/2010
Use the User Importer from the Yaf user Importer Page (available from within the Module Actions Menu)
UserPostedImage
Hamid1920
  • Posts: 6
  • Joined: 30/10/2014
thank you very much
u helped me alot
My second question is
I created all forums manually
now I need to import All topics and related posts into yaf is it enough filling topics into yaf_Topic table and Posts into yaf_message or its needed another tables to be filled?
or is there any procedure to do this
tha_watcha
  • Posts: 4083
  • Joined: 06/03/2010
Originally Posted by: Hamid1920

thank you very much
u helped me alot
My second question is
I created all forums manually
now I need to import All topics and related posts into yaf is it enough filling topics into yaf_Topic table and Posts into yaf_message or its needed another tables to be filled?
or is there any procedure to do this



No this not enough, unfortunately there is no easy way. You need to know the db structure of the dnn forum and yaf to migrate everything from the dnn forum to the yaf forum


UserPostedImage
Hamid1920
  • Posts: 6
  • Joined: 30/10/2014
Any help?
Any help would be greatly appreciated
Zero2Cool
  • Posts: 1082
  • Joined: 26/04/2011
Originally Posted by: Hamid1920

Any help?
Any help would be greatly appreciated



I am not sure specifically what you are seeking help with.

What input for the SP's are you having troubles with?

Are you getting any errors?


Below is code that I am using to tie messages to a specific TopicID. I don't know if this will help, but you'll see the parameters you must include and the Flags value to use.

 private bool InsertMessage(MessageImportItem M, int GameDayTopicID, long messageID)
        {
            try
            {
                using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["yaf"].ConnectionString))
                {
                    connection.Open();
                    using (SqlCommand command = new SqlCommand("yaf_message_save", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        

                        var paramMessageID = new SqlParameter("@MessageID", messageID) { Direction = ParameterDirection.Output };


                        //command.Parameters.Add(new SqlParameter("@MessageID"));
                        command.Parameters.Add(new SqlParameter("@TopicID", GameDayTopicID));
                        command.Parameters.Add(new SqlParameter("@UserID", M.UserID));
                        command.Parameters.Add(new SqlParameter("@Message", M.Message));
                        command.Parameters.Add(new SqlParameter("@UserName", M.Username));
                        command.Parameters.Add(new SqlParameter("@IP", M.IP));
                        command.Parameters.Add(new SqlParameter("@Posted", M.Posted));
                        command.Parameters.Add(new SqlParameter("@ReplyTo", messageID));
                        //command.Parameters.Add(new SqlParameter("@BlogPostID      nvarchar(50) = null,
                        //command.Parameters.Add(new SqlParameter("@ExternalMessageId nvarchar(255) = null,
                        //command.Parameters.Add(new SqlParameter("@ReferenceMessageId nvarchar(255) = null,
                        command.Parameters.Add(new SqlParameter("@Flags", 22));
                        command.Parameters.Add(new SqlParameter("@UTCTIMESTAMP", M.Posted));
                        command.Parameters.Add(paramMessageID);
                        messageID = (long)paramMessageID.Value;
                        command.ExecuteNonQuery();
                        return true;
                    }
                }
            }
            catch (Exception ex)
            {
                ShowAlert("danger alert-dismissible", "x", "SQL", ex.Message);
                return false;
            }

        }
         
Hamid1920
  • Posts: 6
  • Joined: 30/10/2014
Originally Posted by: Zero2Cool

Originally Posted by: Hamid1920

Any help?
Any help would be greatly appreciated



I am not sure specifically what you are seeking help with.

What input for the SP's are you having troubles with?

Are you getting any errors?


Below is code that I am using to tie messages to a specific TopicID. I don't know if this will help, but you'll see the parameters you must include and the Flags value to use.

 private bool InsertMessage(MessageImportItem M, int GameDayTopicID, long messageID)
        {
            try
            {
                using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["yaf"].ConnectionString))
                {
                    connection.Open();
                    using (SqlCommand command = new SqlCommand("yaf_message_save", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        

                        var paramMessageID = new SqlParameter("@MessageID", messageID) { Direction = ParameterDirection.Output };


                        //command.Parameters.Add(new SqlParameter("@MessageID"));
                        command.Parameters.Add(new SqlParameter("@TopicID", GameDayTopicID));
                        command.Parameters.Add(new SqlParameter("@UserID", M.UserID));
                        command.Parameters.Add(new SqlParameter("@Message", M.Message));
                        command.Parameters.Add(new SqlParameter("@UserName", M.Username));
                        command.Parameters.Add(new SqlParameter("@IP", M.IP));
                        command.Parameters.Add(new SqlParameter("@Posted", M.Posted));
                        command.Parameters.Add(new SqlParameter("@ReplyTo", messageID));
                        //command.Parameters.Add(new SqlParameter("@BlogPostID      nvarchar(50) = null,
                        //command.Parameters.Add(new SqlParameter("@ExternalMessageId nvarchar(255) = null,
                        //command.Parameters.Add(new SqlParameter("@ReferenceMessageId nvarchar(255) = null,
                        command.Parameters.Add(new SqlParameter("@Flags", 22));
                        command.Parameters.Add(new SqlParameter("@UTCTIMESTAMP", M.Posted));
                        command.Parameters.Add(paramMessageID);
                        messageID = (long)paramMessageID.Value;
                        command.ExecuteNonQuery();
                        return true;
                    }
                }
            }
            catch (Exception ex)
            {
                ShowAlert("danger alert-dismissible", "x", "SQL", ex.Message);
                return false;
            }

        }
         


thank you very much
I know how to user sps
only I want to be certain nothing will be missed when I use these sps
and these sps is enuogh and no other sp is needed
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved