YAFLogo

Hamid1920
  • Hamid1920
  • 54.2% (Neutral)
  • YAF Forumling Topic Starter
8 years ago
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
8 years ago
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
  • Hamid1920
  • 54.2% (Neutral)
  • YAF Forumling Topic Starter
8 years ago
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
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
8 years ago
Use the User Importer from the Yaf user Importer Page (available from within the Module Actions Menu)
Hamid1920
  • Hamid1920
  • 54.2% (Neutral)
  • YAF Forumling Topic Starter
8 years ago
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
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
8 years ago
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

Hamid1920
  • Hamid1920
  • 54.2% (Neutral)
  • YAF Forumling Topic Starter
8 years ago
Originally Posted by: tha_watcha 

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



When I looked at stored procedures there were two sp named yaf_message_save and yaf_topic_save when I Use this sps topic and posts created successfuly and everyting seems ok like user post count user post search
I dont know what maybe goes wrong ?
by the way I know structure of dnn forum only things I need is how can correctly import exported dnn forum (Posts and Topics) to yaf
Either I Know how should I fill foreign keys on sps input
Hamid1920
  • Hamid1920
  • 54.2% (Neutral)
  • YAF Forumling Topic Starter
8 years ago
Any help?
Any help would be greatly appreciated
Zero2Cool
8 years ago
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
  • Hamid1920
  • 54.2% (Neutral)
  • YAF Forumling Topic Starter
8 years ago
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
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
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